php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34831 parse_url behavior changed from 5.0.4 to 5.0.5 breaks code
Submitted: 2005-10-11 17:26 UTC Modified: 2005-10-11 17:50 UTC
From: jason at eblasterpro dot com Assigned:
Status: Not a bug Package: URL related
PHP Version: 5.0.5 OS: Mandrake 10.2
Private report: No CVE-ID: None
 [2005-10-11 17:26 UTC] jason at eblasterpro dot com
Description:
------------
results differ from php-5.0.4 to php-5.0.5 for parse_url with  host and scheme replaced with host and path


Reproduce code:
---------------
example of problem
php-5.0.4:
print_r(parse_url('href="http://mysite.com'));
results:
url = Array[2]
--->host= mysite.com
--->scheme= href="http

php-5.0.5:
print_r(parse_url('href="http://mysite.com'));
results:
url = Array[2]
--->host= href="http
--->path= //mysite.com

Expected result:
----------------
the returned result should not change between versions the correct return should be
url = Array[2]
--->host= mysite.com
--->scheme= href="http

Actual result:
--------------
the incorrect result
url = Array[2]
--->host= href="http
--->path= //mysite.com



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-11 17:36 UTC] tony2001@php.net
'href="http://mysite.com' is not a correct URL, nobody told you that parse_url() will behave in the same way with invalid URLs.
No bug here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Oct 04 17:01:27 2024 UTC