Bug #73500 [NEW]: parse_url behaviour changed between 7.0.12 and 7.0.13 when pw begins with #

From: Date: Fri, 11 Nov 2016 15:08:27 +0000
Subject: Bug #73500 [NEW]: parse_url behaviour changed between 7.0.12 and 7.0.13 when pw begins with #
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-205307@lists.php.net to get a copy of this message
From: max at substrakt dot com Operating system: Ubuntu Linux PHP version: 7.0.13 Package: URL related Bug Type: Bug Bug description:parse_url behaviour changed between 7.0.12 and 7.0.13 when pw begins with # Description: ------------ When running the following code on PHP 7.0.12 and 7.0.13, a different result is returned. In the later version, the user and pass attributes are missing. This _only_ occurs when the first character of the password is # (hash/pound). Strong passwords can often include the # symbol so this is unexpected behaviour. I've not raised a bug in PHP before, please let me know if you need further information to resolve this! Test script: --------------- <?php $url = "mysql://user:#fhdsjfghjdf@host.eu-west-1.rds.amazonaws.com:3306/database_name"; var_dump(parse_url($url)); Expected result: ---------------- array(6) { ["scheme"]=> string(5) "mysql" ["host"]=> string(32) "host.eu-west-1.rds.amazonaws.com" ["port"]=> int(3306) ["user"]=> string(4) "user" ["pass"]=> string(12) "#fhdsjfghjdf" ["path"]=> string(14) "/database_name" } Actual result: -------------- array(3) { ["scheme"]=> string(5) "mysql" ["host"]=> string(4) "user" ["fragment"]=> string(63) "fhdsjfghjdf@host.eu-west-1.rds.amazonaws.com:3306/database_name" } -- Edit bug report at https://bugs.php.net/bug.php?id=73500&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73500&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73500&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73500&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73500&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73500&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73500&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73500&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73500&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73500&r=support Expected behavior: https://bugs.php.net/fix.php?id=73500&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73500&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73500&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73500&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73500&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73500&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73500&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73500&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73500&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73500&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73500&r=mysqlcfg

« previous php.bugs (#205307) next »