Bug #73639 [NEW]: parse_url fails when ? is present in the password section
| From: | jazzerman+php at gmail dot com | Date: | Fri, 02 Dec 2016 01:47:33 +0000 |
| Subject: | Bug #73639 [NEW]: parse_url fails when ? is present in the password section | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-205729@lists.php.net to get a copy of this message | ||
From: jazzerman+php at gmail dot com
Operating system: Linux
PHP version: 5.6.28
Package: *URL Functions
Bug Type: Bug
Bug description:parse_url fails when ? is present in the password section
Description:
------------
---
From manual page: http://www.php.net/function.parse-url
---
I was using PHPActiveRecord and the framework utilizes parse_url to
store the settings for DB connection. E.g.
$db_conn =
'mysql://db_username:zZ?Zmasdfj3459f8g7L0I$Ai5}OGe@localhost/db_name?charset=utf8';
print_r(parse_url($db_conn));
It was all working fine in all previous versions of PHP but with 5.6.28
for some reason it stopped parsing the string above. After testing I
realized "?" in the password field causes the function to fail.
Please fix. Thanks!
Test script:
---------------
$db_conn =
'mysql://username:zZ?Zmasdfj3459f8g7L0I$Ai5}OGe@localhost/db_name?charset=utf8';
print_r(parse_url($db_conn));
Expected result:
----------------
Array
(
[scheme] => mysql
[host] => localhost
[user] => username
[pass] => zZ?Zmasdfj3459f8g7L0I$Ai5}OGe
[path] => /db_name
[query] => charset=utf8
)
Actual result:
--------------
bool(false)
--
Edit bug report at https://bugs.php.net/bug.php?id=73639&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73639&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73639&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73639&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73639&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73639&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73639&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73639&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73639&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73639&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73639&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73639&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73639&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73639&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73639&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73639&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73639&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73639&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73639&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73639&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73639&r=mysqlcfg