#29151 [Ana]: bugs.php.net fails to insert vote

From: Date: Wed, 04 Aug 2004 17:57:18 +0000
Subject: #29151 [Ana]: bugs.php.net fails to insert vote
References: 1  Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-25671@lists.php.net to get a copy of this message
ID: 29151 Updated by: dave@php.net Reported By: fdsoft at pganet dot com Status: Analyzed Bug Type: Website problem Operating System: irrelevant PHP Version: Irrelevant Assigned To: jacques New Comment: > if (ip2long($ips[$i]) != -1) { Remember, as of PHP 5.0.0 ip2long() returns FALSE instead of -1. Previous Comments: ------------------------------------------------------------------------ [2004-08-04 19:27:43] jacques@php.net I've updated the patchfile and uploaded it to http://www.powertrip.co.za/patches/php-bugs-web-29151.diff for review. ------------------------------------------------------------------------ [2004-08-04 19:23:17] jacques@php.net Okay I've slightly changed the patch. Which uses ip2long on the current IP it's working through to validate if the string is really an ip address (http://php.mirrors.powertrip.co.za/ip2long) if we get -1 back from ip2long we know this a valid ip address. if (!eregi ("^(10|172\.16|192\.168)\.", $ips[$i])) { if (ip2long($ips[$i]) != -1) { $ip = $ips[$i]; break; } } My pseudo code test returns the expected ip address even when I use 'unknown' and various other varients for the forwarded address. ------------------------------------------------------------------------ [2004-08-04 15:49:55] goba@php.net OK then it still needs to be tested whether the found IP matches an IP address regexp. ------------------------------------------------------------------------ [2004-08-04 15:26:14] fdsoft at pganet dot com I have a feeling this still isn't going to work for me. As I said, $_SERVER['HTTP_X_FORWARED_FOR"] is set to the string "unknown" No IP numbers anywhere at all in it, or any kind of a number. This is a common configuration option for the Squid proxy. ------------------------------------------------------------------------ [2004-08-04 14:19:26] derick@php.net Make sure to test it carefully! ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29151 -- Edit this bug report at http://bugs.php.net/?id=29151&edit=1

« previous php.mirrors (#25671) next »