Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.15

Bug #7649 Net_URL doens't complain about invalid URLs
Submitted: 2006-05-17 12:33 UTC
From: mfischer at php dot net Assigned: davidc
Status: Bogus Package: Net_URL (version 1.0.14)
PHP Version: Irrelevant OS: Any
Roadmaps: 1.0.15    
Subscription  


 [2006-05-17 12:33 UTC] mfischer at php dot net (Markus Fischer)
Description: ------------ Net_URL accepts invalid URLs like "http://www.netcraft.com/ not allowed". This is evident when you e.g. try to use HTTP_Request to fetch a URL. Internally, HTTP_Request is passing the URL to Net_URL and Net_URL happily accepts the invalid URL. Common sense of user agents is that they convert the space, which violates the specs, to e.g. + or %20. This is verified with wget, lynx, FF, IE, Opera. Because of this the server response differently and very likely not as expected. It seems related to http://pear.php.net/bugs/bug.php?id=2991 Test script: --------------- require_once "HTTP/Request.php"; $req = new HTTP_Request("http://www.netcraft.com/ not found"); $req->sendRequest(); var_dump($req->getResponseCode()); Expected result: ---------------- int(404) Actual result: -------------- int(400)

Comments

 [2007-05-07 22:44 UTC] davidc (David Coallier)
The job of Net_URL is not to validate and apply transformation (trim, etc) to the urls but get their properties. You have to do this in userland.