php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38143 parse_url() cannot parse urls with "http://" in the url query or path
Submitted: 2006-07-19 14:59 UTC Modified: 2006-07-30 01:00 UTC
Votes:16
Avg. Score:4.3 ± 0.9
Reproduced:16 of 16 (100.0%)
Same Version:1 (6.2%)
Same OS:3 (18.8%)
From: jalal at spread-it dot org Assigned:
Status: No Feedback Package: URL related
PHP Version: 4.4.2 OS: Fedora Core 4
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-07-19 14:59 UTC] jalal at spread-it dot org
Description:
------------
I noticed that parse_url cannot parse urls with "http://" in the query or in the path
For example :
http://www.google.fr/url?sa=t&oi=promos&cad=hppphou%3Afr_all&ct=pro&cd=1&url=http%3A%2F%2Fwww.google.fr%2Furl%3Fsa%3Dp%26pref%3Dig%26pval%3D3%26q%3Dhttp%3A%2F%2Fwww.google.fr%2Fig%253Fhl%253Dfr%2526tab%253Diw%2526q%253D&ei=Aka-RJ6_L7K8mgGezfGiCQ
http://www.yahoo.com/r/sx/*-http://search.yahoo.com/search

Reproduce code:
---------------
$url_info = parse_url("http://www.yahoo.com/r/sx/*-http://search.yahoo.com/search");

Expected result:
----------------
$url_info['scheme'] => "http"
$url_info['host'] => "www.yahoo.com"
...

Actual result:
--------------
Warning: parse_url(http://www.yahoo.com/r/sx/*-http://search.yahoo.com/search): Unable to parse url in /var/www/html/test/index.php on line 3

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-22 12:14 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-07-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2008-06-04 16:23 UTC] ptr at fnal dot gov
This bug still exists in 5.2.6 and it is causing Apache (2.2.8) to core dump.  Under 5.2.4 the error did not cause core-dumps; this seems a recent addition to 5.2.8.

Example:

[Wed Jun 04 10:58:56 2008] [error] [client xx.xx.xx.xx] PHP Warning:  parse_url(//script/data/data.php?=http://www.7-miles.com/media/buddy_icons/users.txt??) [<a href='function.parse-url'>function.parse-url</a>]: Unable to parse URL in /path/to/php/files/index.php on line 12

[Wed Jun 04 10:59:00 2008] [notice] child pid 4324 exit signal Segmentation fault (11), possible coredump in /path/to/apache/server


OS: Solaris 10
Apache: 2.2.8
PHP: 5.2.6
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 07:02:02 2014 UTC