Bug #72811 [NEW]: parse_url fails with IPv6 host

From: Date: Thu, 11 Aug 2016 11:47:39 +0000
Subject: Bug #72811 [NEW]: parse_url fails with IPv6 host
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203192@lists.php.net to get a copy of this message
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)

« previous php.bugs (#203192) next »