php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24836 parse_url, FTP username problem
Submitted: 2003-07-28 01:58 UTC Modified: 2003-07-28 07:41 UTC
From: php at davidmatthews dot info Assigned:
Status: Not a bug Package: URL related
PHP Version: 4.3.2 OS: Win2k, Redhat 8
Private report: No CVE-ID: None
 [2003-07-28 01:58 UTC] php at davidmatthews dot info
Description:
------------
Problem when the @(AT) sign when part of the user name during a FTP scheme.

The common escape sequence of "%40" is documented within this report, "#&0040" was also tried as an escape sequence - but never fixed the problem either.

(1 SOLUTION:  Make the parser look for the (@)AT sign from the right, after the last '/' token, therefore there is no need to use escape sequences for the special character within the name)


Reproduce code:
---------------
print_r( parse_url("ftp://user%40sample.com:passcode@host.com"));

Expected result:
----------------
Array ( [scheme] => ftp [host] => host.com [user] => user@sample.com [pass] => passcode ) 


Actual result:
--------------
Array ( [scheme] => ftp [host] => host.com [user] => user%40sample.com [pass] => passcode ) 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-28 07:41 UTC] iliaa@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

prase_url never did url decoding on the various parts.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 22:01:27 2024 UTC