Re: http_build_query ... argh
| From: | Arpad Ray | Date: | Thu, 09 Nov 2006 16:53:43 +0000 |
| Subject: | Re: http_build_query ... argh | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244434@lists.php.net to get a copy of this message | ||
Jochem Maas wrote:
function inputPostQueryUnBorker($s)
{
return preg_replace('#(\?|&(?:amp;)?)([^=]*)=#eU',
"'\\1'.str_replace(array('%5B','%5D'), array('[',']'), '\\2').'='",
$s);
}
so how bad is it
This is a bit more concise. I doubt there'd be a noticable difference in speed though:
return preg_replace('#%5[bd](?=[^&]*=)#ei', 'urldecode("\0")', $s);
Arpad