Re: Suggestion for get_headers

From: Date: Mon, 10 Mar 2008 00:15:56 +0000
Subject: Re: Suggestion for get_headers
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-36070@lists.php.net to get a copy of this message
Justin Martin wrote:
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
Hi again, Just noticed a discrepancy in my suggestion. I hadn't taken into account that urlencode would encode everything, including parts of the domain name. A solution would have to be used to avoid this. Thanks, Justin Martin

« previous php.internals (#36070) next »