codesite...@google.com
unread,Feb 12, 2009, 9:57:40 AM2/12/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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