minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Search | Statistics | Manual |
Bugs miniBB Community Forum / Bugs /

Undefined variable: ip

 
Anonymous
Guest
#1 | Posted: 11 Jul 2007 11:20
I'm getting an error in my error_log:

PHP Notice: Undefined variable: ip in /srv/www/htdocs/forum/bb_functions.php on line 128


Here is where it comes from in bb_functions.php. Is it because it can't get an ip for some reason from the host?

function getIP(){
$ip1=getenv('REMOTE_ADDR');$ip2=getenv('HTTP_X_FORWARDED_FOR');
if($ip2!='' and preg_match("/^[0-9.]+$/", $ip) and ip2long($ip2)!=-1) $finalIP=$ip2; else $finalIP=$ip1;
$finalIP=substr($finalIP,0,15);
return $finalIP;
}
Team
8-)
#2 | Posted: 11 Jul 2007 11:44
Please upgrade this function from the version what we have now in Downloads. We know about this bug and have fixed it recently.

The function should list:

function getIP(){
$ip1=$_SERVER['REMOTE_ADDR'];
if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ip2=$_SERVER['HTTP_X_FORWARDED_FOR']; else $ip2='';
if($ip2!='' and preg_match("/^[0-9.]+$/", $ip2) and ip2long($ip2)!=-1) $finalIP=$ip2; else $finalIP=$ip1;
$finalIP=substr($finalIP,0,15);
return $finalIP;
}
 
This topic is closed. You can't post a reply.
 
Online now: Guests - 31
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®