Bug #71822 [NEW]: parse_url on 7.1.0-dev returns false where password contains a `-` character

From: Date: Mon, 14 Mar 2016 13:40:03 +0000
Subject: Bug #71822 [NEW]: parse_url on 7.1.0-dev returns false where password contains a `-` character
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199817@lists.php.net to get a copy of this message
From: nigel dot greenway at futurepixels dot co dot uk Operating system: Linux - BunsenLabs PHP version: Next Major Version Package: *URL Functions Bug Type: Bug Bug description:parse_url on 7.1.0-dev returns false where password contains a - character 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 bug report at https://bugs.php.net/bug.php?id=71822&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71822&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71822&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71822&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71822&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71822&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71822&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71822&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71822&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71822&r=support Expected behavior: https://bugs.php.net/fix.php?id=71822&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71822&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71822&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71822&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71822&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71822&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71822&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71822&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71822&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71822&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71822&r=mysqlcfg

« previous php.bugs (#199817) next »