[PEAR-BUG] Bug #21046 [Com]: checkIPv6 wrongly validates IPv6 IPs with leading and/or trailing :
[email protected] ("phildavis") Fri, 25 Mar 2016 01:11:34 -0400 (EDT)
| Newsgroups | php.pear.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at http://pear.php.net/bugs/bug.php?id=21046&edit=1
ID: 21046
Comment by: phildavis
Reported By: phil dot davis at inf dot org
Summary: checkIPv6 wrongly validates IPv6 IPs with leading
and/or trailing :
Status: Open
Type: Bug
Package: Net_IPv6
Operating System: FreeBSD
Package Version: 1.2.1
PHP Version: 5.6.19
New Comment:
Proposed fix at https://github.com/pear/Net_IPv6/pull/14
Previous Comments:
------------------------------------------------------------------------
[2016-03-24 19:39:52] cbuechler
Description:
------------
Net_IPv6::checkIPv6 wrongly validates full length IPv6 IPs that have a
leading and/or trailing colon.
Test script:
---------------
these three examples should return false, but return true:
var_dump(Net_IPv6::checkIPv6("1234:5678:90AB:CDEF:1234:5678:90AB:CDEF:"));
var_dump(Net_IPv6::checkIPv6(":1234:5678:90AB:CDEF:1234:5678:90AB:CDEF"));
var_dump(Net_IPv6::checkIPv6(":1234:5678:90AB:CDEF:1234:5678:90AB:CDEF:"));
Expected result:
----------------
The three examples provided aren't valid IPv6 IPs and should return
false,
not true.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=21046&edit=1