Bug #71822 [Opn]: parse_url on 7.1.0-dev returns false where password contains a `-` character
| From: | derick@php.net | Date: | Mon, 14 Mar 2016 13:52:11 +0000 |
| Subject: | Bug #71822 [Opn]: parse_url on 7.1.0-dev returns false where password contains a `-` character | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199818@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71822&edit=1
ID: 71822
Updated by: derick@php.net
Reported by: nigel dot greenway at futurepixels dot co dot uk
Summary: parse_url on 7.1.0-dev returns false where password
contains a
- character
Status: Open
Type: Bug
Package: *URL Functions
Operating System: Linux - BunsenLabs
PHP Version: Next Major Version
Block user comment: N
Private report: N
New Comment:
I've tried this and can reproduce this. It's changed from PHP 7.0.3 where having a - works
fine.
Previous Comments:
------------------------------------------------------------------------
[2016-03-14 13:40:01] nigel dot greenway at futurepixels dot co dot uk
Description:
------------
Passing hyphenated username and passwords as part of a url to url_parse returns false.
Test script:
---------------
<?php
var_dump(
parse_url('http://some:password@ex-ample.co.uk'),
parse_url('http://so-me:password@192.168.0.123'),
parse_url('http://some:pass-word@192.168.0.123')
);
Expected result:
----------------
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(14) "ex-ample.co.uk"
["user"]=>
string(4) "some"
["pass"]=>
string(8) "password"
}
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(14) "192.168.0.123"
["user"]=>
string(4) "so-me"
["pass"]=>
string(8) "password"
}
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(14) "192.168.0.123"
["user"]=>
string(4) "some"
["pass"]=>
string(8) "pass-word"
}
Actual result:
--------------
array(4) {
["scheme"]=>
string(4) "http"
["host"]=>
string(14) "ex-ample.co.uk"
["user"]=>
string(4) "some"
["pass"]=>
string(8) "password"
}
bool(false)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71822&edit=1