php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31705 parse_url: http://foo.com#bar not recognized
Submitted: 2005-01-26 18:26 UTC Modified: 2005-01-27 17:38 UTC
From: cox at idecnet dot com Assigned:
Status: Closed Package: URL related
PHP Version: 4.3.10 OS: Linux
Private report: No CVE-ID: None
 [2005-01-26 18:26 UTC] cox at idecnet dot com
Description:
------------
This url format is not recognized by parse_url():

http://foo.com#bar

Most browsers do recognize this format. Others like "http://foo.com?bar" are rightly parsed.


Tomas V.V.Cox

Reproduce code:
---------------
php -r 'print_r(parse_url("http://foo.com#bar"));'

Expected result:
----------------
Array
(
    [scheme] => http
    [host] => foo.com
    [fragment] => bar
)


Actual result:
--------------
Array
(
    [scheme] => http
    [host] => foo.com#bar
)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-27 17:38 UTC] [email protected]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 10 04:01:34 2025 UTC