Bug #72811 [NEW]: parse_url fails with IPv6 host
From: me at kelunik dot com
Operating system: *
PHP version: Irrelevant
Package: URL related
Bug Type: Bug
Bug description:parse_url fails with IPv6 host
Description:
------------
PHP fails to parse the host part if an IPv6 address is used in
combination with a port.
Test script:
---------------
<?php
// See https://3v4l.org/7uVWs
var_dump(parse_url("127.0.0.1:80", PHP_URL_HOST));
var_dump(parse_url("[::1]:80", PHP_URL_HOST));
Expected result:
----------------
string(9) "127.0.0.1"
string(5) "[::1]"
Actual result:
--------------
string(9) "127.0.0.1"
NULL
--
Edit bug report at https://bugs.php.net/bug.php?id=72811&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72811&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72811&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72811&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72811&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72811&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72811&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72811&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72811&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72811&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72811&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72811&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72811&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72811&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72811&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72811&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72811&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72811&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72811&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72811&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72811&r=mysqlcfg
Thread (3 messages)
- me at kelunik dot com