Edit report at http://bugs.php.net/bug.php?id=54180&edit=1

 ID:                 54180
 Updated by:         pierr...@php.net
 Reported by:        gasper at kozak dot si
 Summary:            parse_url() incorrectly parses path when ? in
                     fragment
-Status:             Open
+Status:             Closed
 Type:               Bug
 Package:            URL related
 PHP Version:        5.3.5
-Assigned To:        
+Assigned To:        pierrick
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2011-03-13 05:02:59] pierr...@php.net

Automatic comment from SVN on behalf of pierrick
Revision: http://svn.php.net/viewvc/?view=revision&revision=309159
Log: Fixed bug #54180 (parse_url() incorrectly parses path when ? in
fragment)

------------------------------------------------------------------------
[2011-03-07 14:43:29] gasper at kozak dot si

This works if '?' is also present _before_ the fragment:



$p =
parse_url('http://example.com/path/script.html?query#fragment?data');

print_r($p);



Outputs correctly:



Array

(

    [scheme] => http

    [host] => example.com

    [path] => /path/script.html

    [query] => query

    [fragment] => fragment?data

)

------------------------------------------------------------------------
[2011-03-07 14:29:46] gasper at kozak dot si

Description:
------------
It seems that parse_url() ignores the path when fragment identifier
includes a 

question mark (?). 



A few similar bugs were already reported (and fixed), but none of them
is the 

same; this one affects the path part of the url.

Test script:
---------------
$p = parse_url('http://example.com/path/script.html#fragment?data');

print_r($p);



Expected result:
----------------
Array

(

    [scheme] => http

    [host] => example.com

    [path] => /path/script.html

    [fragment] => fragment?data

)



Actual result:
--------------
Array

(

    [scheme] => http

    [host] => example.com

    [fragment] => fragment?data

)




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=54180&edit=1

Reply via email to