Suggestion for get_headers
| From: | Justin Martin | Date: | Mon, 10 Mar 2008 00:03:38 +0000 |
| Subject: | Suggestion for get_headers | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-36069@lists.php.net to get a copy of this message | ||
Hi there,
I have a suggestion regarding get_headers, however I do not have a knowledge of C with which to provide a patch.
The function get_headers is, as most will know, used to retrieve headers generated by an HTTP request. The primary parameter to this, "string $url", is provided unencoded. Due to this, any request with special characters (i.e. a space), will return 400 BAD REQUEST. My suggestion to remedy this, would be to internally apply the function "urlencode" to the $url parameter. This would automatically encode any provided URL, while remaining transparent.
Any comments?
Thanks,
Justin Martin