php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50484 parse_url can't handle with url, where password part contains slash "/"
Submitted: 2009-12-15 21:13 UTC Modified: 2009-12-16 02:43 UTC
From: max dot antonoff at gmail dot com Assigned:
Status: Not a bug Package: URL related
PHP Version: 5.3.1 OS: Linux 2.6.31
Private report: No CVE-ID: None
 [2009-12-15 21:13 UTC] max dot antonoff at gmail dot com
Description:
------------
parse_url can not handle password part, if it contains slash. 

Reproduce code:
---------------
php -r "print_r(parse_url('test://fuuu:de/st@folsd/lala?fio=9&slsl=290sk'));"
Array
(
    [scheme] => test
    [host] => fuuu
    [path] => /st@folsd/lala
    [query] => fio=9&slsl=290sk
)

Expected result:
----------------
Array
(
    [scheme] => test
    [host] => folsd
    [user] => fuuu
    [pass] => de/st
    [path] => /lala
    [query] => fio=9&slsl=290sk
)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-16 02:43 UTC] aharvey@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

parse_url is behaving per the spec here, since RFC 3986 doesn't allow slash characters within the userinfo component of the URL: slashes need to be percent-encoded to be used.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 16:01:31 2024 UTC