php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55399 parse_url() returning inccorrect value
Submitted: 2011-08-11 11:08 UTC Modified: 2011-08-11 13:03 UTC
From: chris at gedrim dot co dot uk Assigned: iliaa
Status: Closed Package: URL related
PHP Version: 5.3.6 OS: Windows 7 Professional x64
Private report: No CVE-ID:
 [2011-08-11 11:08 UTC] chris at gedrim dot co dot uk
Description:
------------
parse_url() in 5.3.5 would return false when called with ':' (malformed url).

When called with ':' in 5.3.6 parse_url() returns:

array (
    'path' => ':',
)

Test script:
---------------
var_dump(parse_url(':'));

Expected result:
----------------
bool(false)


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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-11 11:39 UTC] laruence@php.net
in php 5.3.6 , url.c line 188 added a condition   if (pp - p > 0 && pp - p < 6 && 
(*pp == '/' || *pp == '\0'))  ...

"pp-p >0" which make the whole flow changed 

then result a valid ret->path return,   hope this could be a help :P
 [2011-08-11 12:46 UTC] iliaa@php.net
-Assigned To: +Assigned To: iliaa
 [2011-08-11 13:01 UTC] iliaa@php.net
Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=314783
Log: Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path)
 [2011-08-11 13:03 UTC] iliaa@php.net
-Status: Assigned +Status: Closed
 [2011-08-11 13:03 UTC] iliaa@php.net
This bug has been fixed in SVN.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:49 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=78c823067f66de77bb3424b523dc5d7bf242d46a
Log: Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path)
 [2012-07-17 12:43 UTC] dk at cabag dot ch
But now links like 'http://www.mysite.com/id=L:0/123' return false.
 [2012-07-24 23:40 UTC] rasmus@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=78c823067f66de77bb3424b523dc5d7bf242d46a
Log: Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path)
 [2013-11-17 09:37 UTC] laruence@php.net
Automatic comment on behalf of iliaa
Revision: http://git.php.net/?p=php-src.git;a=commit;h=78c823067f66de77bb3424b523dc5d7bf242d46a
Log: Fixed bug #55399 (parse_url() incorrectly treats ':' as a valid path)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 14:02:18 2014 UTC