Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36070 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26274 invoked from network); 10 Mar 2008 00:15:58 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Mar 2008 00:15:58 -0000 X-Host-Fingerprint: 207.81.73.169 d207-81-73-169.bchsia.telus.net Received: from [207.81.73.169] ([207.81.73.169:13781] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0A/AF-43615-EBD74D74 for ; Sun, 09 Mar 2008 19:15:58 -0500 Message-ID: <0A.AF.43615.EBD74D74@pb1.pair.com> To: internals@lists.php.net Date: Sun, 09 Mar 2008 17:15:56 -0700 User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 References: <3D.4F.43615.CDA74D74@pb1.pair.com> In-Reply-To: <3D.4F.43615.CDA74D74@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 207.81.73.169 Subject: Re: Suggestion for get_headers From: frozenfire@thefrozenfire.com (Justin Martin) 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