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
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: jason at eblasterpro dot com
New email:
PHP Version: OS:

 

 [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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 19:01:37 2025 UTC