[PEAR-BUG] Bug #20421 [Com]: Reject invalid path

[email protected] ("[email protected]") Fri, 3 Oct 2014 00:01:43 +0100 (BST)
Newsgroups php.pear.bugs
Message-ID <[email protected]>
Edit report at https://pear.php.net/bugs/bug.php?id=20421&edit=1

 ID:               20421
 Comment by:       [email protected]
 Reported By:      jan dot prachar at gmail dot com
 Summary:          Reject invalid path
 Status:           Open
 Type:             Bug
 Package:          Net_URL2
 Package Version:  2.0.7
 PHP Version:      Irrelevant
 Roadmap Versions: 
 New Comment:

As well as when you set path first and then add/remove authority.


Previous Comments:
------------------------------------------------------------------------

[2014-10-02 23:56:49] pracj3am

Description:
------------
See https://tools.ietf.org/html/rfc3986#section-3.3

Path should be empty or begin with slash if authority is present.
If a URI  does not contain an authority component, then the path cannot
begin with two 
slash characters.

Test script:
---------------
$url = new Net_URL2('http:g');                                          
           
$url->setPath('//h');                                                   
           
echo $url->getUrl(); 

Expected result:
----------------
*exception thrown*

Actual result:
--------------
http://h

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


-- 
Edit this bug report at https://pear.php.net/bugs/bug.php?id=20421&edit=1