#29151 [Ana]: bugs.php.net fails to insert vote
| From: | jacques@php.net | Date: | Fri, 06 Aug 2004 18:48:29 +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-25716@lists.php.net to get a copy of this message | ||
ID: 29151
Updated by: jacques@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:
I'll commit the following patch
http://www.powertrip.co.za/patches/php-bugs-web-29151.diff
in the
morning as it works as expected on my development version of
php-bugs-web.
Previous Comments:
------------------------------------------------------------------------
[2004-08-06 13:08:50] jacques@php.net
Dave thanks for the 'headsup'. I have a patch against phpweb for the
same issue as well as checking which version of php is running on the
webserver. For phpweb look at this patch
http://www.powertrip.co.za/patches/phpweb-29151.diff
and I'll update
the patch for php-bugs-web shorlty which will be made available over at
http://www.powertrip.co.za/patches/php-bugs-web-29151.diff
for review.
I've tested the phpweb patch on http://php.mirrors.powertrip.co.za/ and
it works when going through a test squid cache server here at my office
and then via two netcache boxes at SAIX.
------------------------------------------------------------------------
[2004-08-04 19:57:18] dave@php.net
> if (ip2long($ips[$i]) != -1) {
Remember, as of PHP 5.0.0 ip2long() returns FALSE instead of -1.
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
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