php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73595 parse_url fails if passing '#' in passwd
Submitted: 2016-11-23 20:24 UTC Modified: 2016-11-23 20:38 UTC
From: dakusan at castledragmire dot com Assigned:
Status: Duplicate Package: URL related
PHP Version: 5.6.28 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dakusan at castledragmire dot com
New email:
PHP Version: OS:

 

 [2016-11-23 20:24 UTC] dakusan at castledragmire dot com
Description:
------------
I believe this happened in commit "f0f68c72744a42a1c376a832dd01c012c0929e88". The reason I am considering this a bug is that it broke expected behavior in a minor version change.

Test script:
---------------
var_dump(parse_url('mysql://username:xxx#xxx@localhost/databasename'));

Expected result:
----------------
array(5) { ["scheme"]=> string(5) "mysql" ["host"]=> string(9) "localhost" ["user"]=> string(8) "username" ["pass"]=> string(7) "xxx#xxx" ["path"]=> string(13) "/databasename" } 


Actual result:
--------------
FALSE

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-23 20:38 UTC] requinix@php.net
-Status: Open +Status: Duplicate
 [2016-11-23 20:38 UTC] requinix@php.net
Allowing # like that was a bug - security bug, no less - which is why it was fixed. You should be urlencode()ing the password.

See also bug #73500
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 23:01:29 2024 UTC