Re: http_build_query ... argh
| From: | Jochem Maas | Date: | Fri, 10 Nov 2006 11:14:22 +0000 |
| Subject: | Re: http_build_query ... argh | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244462@lists.php.net to get a copy of this message | ||
Larry Garfield wrote:
> On Thursday 09 November 2006 10:22, Jochem Maas wrote:
>
>> apparently http_build_query() has been 'fixed' so that it now
>> urlencodes square brackets (and if you have never used square brackets in
>> a url pointing a php script then your obviously new here ;-)
>>
>> this is fine - apart from the fact that I have a rather complex generic
>> thingy that not only uses http_build_query() to build actual URLs but
>> also to generate the input names of hidden form fields (sometimes
>> one needs/wants to place a stack of request arguments as hidden inputs
>> instead of as GET parameters of a URL.
>
> Er, wouldn't the better solution be to fix http_build_query to not break when
> handling fairly typical PHP URLs?
http_build_query() was fixed (it's a core function btw) - and the problem is the fact
that it now correctly encoded square brackets (as per HTTP specs) , the urlencoding
makes using the return value of http_build_query() in the name attribute of a
hidden input impossible unless the relevant square brackets are first decoded.
>