php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46973 IPv6 address filter rejects valid address
Submitted: 2008-12-30 14:11 UTC Modified: 2009-06-10 19:06 UTC
From: alexandre at amen dot fr Assigned: felipe (profile)
Status: Closed Package: Filter related
PHP Version: 5.2.8 OS: Debian
Private report: No CVE-ID: None
 [2008-12-30 14:11 UTC] alexandre at amen dot fr
Description:
------------
The IPv6 address filter in the filter extension rejects valid IPv6
address notations: '1fff::a88:85a3::172.31.128.1'


Reproduce code:
---------------
var_dump(filter_var('1fff::a88:85a3::172.31.128.1', FILTER_VALIDATE_IP,FILTER_FLAG_IPV6));

Expected result:
----------------
1fff::a88:85a3::172.31.128.1

Actual result:
--------------
false

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-31 15:41 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2009-06-07 16:55 UTC] rasmus@php.net
You can only have a single :: in an ipv6 address, so this was actually an invalid address. The bug fix (and bug report) is incorrect.
 [2009-06-08 10:53 UTC] alexandre at amen dot fr
oups, I'm sorry, I think I missed my copy/paste.
with this : 
var_dump(filter_var('1fff:0:a88:85a3::172.31.128.1',FILTER_VALIDATE_IP,FILTER_FLAG_IPV6));
It doesn't work

My apologies for the previous error
 [2009-06-08 18:49 UTC] birki456 at hotmail dot com
funny thing is, var_dump(filter_var('1fff::a88:85a3::172.31.128.1', FILTER_VALIDATE_IP,FILTER_FLAG_IPV6));
returns 
string(28) "1fff::a88:85a3::172.31.128.1"
which is wrong

i.e. the implementation AS IS allows _two_ '::' in an ipv6 address
 [2009-06-10 19:06 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Hi, I've fixed the wrong part.

Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 23:01:36 2024 UTC