php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32813 parse_url does not parse 'scheme:' correctly.
Submitted: 2005-04-24 22:30 UTC Modified: 2005-04-26 01:50 UTC
From: mpb dot mail at gmail dot com Assigned:
Status: Closed Package: *URL Functions
PHP Version: 4.*, 5.* OS: FreeBSD and Linux
Private report: No CVE-ID: None
 [2005-04-24 22:30 UTC] mpb dot mail at gmail dot com
Description:
------------
parse_url does not parse 'scheme:' correctly.

--------
From http://www.ietf.org/rfc/rfc1738.txt:

5. BNF for specific URL schemes

[snip]

genericurl     = scheme ":" schemepart

[snip]

schemepart     = *xchar | ip-schemepart

--------

In other words, 'scheme:' is a complete and valid URL; the empty string is a valid schemepart.

parse_url ('scheme:') claims that the *host* is 'scheme'.  This is incorrect.  The *scheme* is 'scheme'.

Thanks!


Reproduce code:
---------------
var_dump (parse_url ('scheme:'));


Expected result:
----------------
array(1) {
  ["scheme"]=>
  string(6) "scheme"
}


Actual result:
--------------
array(1) {
  ["host"]=>
  string(6) "scheme"
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-26 01:50 UTC] iliaa@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC