[surforce-library commit] r46 - trunk/library/Zsurforce/Net

0 views
Skip to first unread message

codesite...@google.com

unread,
Feb 12, 2009, 9:57:40 AM2/12/09
to surforce...@googlegroups.com
Author: enriqueplace
Date: Thu Feb 12 06:35:25 2009
New Revision: 46

Modified:
trunk/library/Zsurforce/Net/Ip.php

Log:
Ajustes sobre errores en strict, sintaxis no válida

Modified: trunk/library/Zsurforce/Net/Ip.php
==============================================================================
--- trunk/library/Zsurforce/Net/Ip.php (original)
+++ trunk/library/Zsurforce/Net/Ip.php Thu Feb 12 06:35:25 2009
@@ -1,13 +1,17 @@
<?php
abstract class Zsurforce_Net_Ip
{
- public function getIp()
+ public static function getIp()
{
- return $_SERVER[REMOTE_ADDR];
+ return $_SERVER['REMOTE_ADDR'];
}
- public function getIpReal()
+ public static function getReferer()
{
- if( $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ){
+ return $_SERVER['HTTP_REFERER'];
+ }
+ public static function getIpReal()
+ {
+ if( getenv('HTTP_X_FORWARDED_FOR') != '' ){
$client_ip =
( !empty($_SERVER['REMOTE_ADDR']) ) ?
$_SERVER['REMOTE_ADDR']
@@ -17,7 +21,7 @@
:
"unknown" );

- $entries = split('[, ]', $_SERVER['HTTP_X_FORWARDED_FOR']);
+ $entries = split('[, ]', getenv('HTTP_X_FORWARDED_FOR'));

reset($entries);

@@ -51,5 +55,4 @@
}
return $client_ip;
}
-}
-?>
\ No newline at end of file
+}
\ No newline at end of file
Reply all
Reply to author
Forward
0 new messages