Closed GoogleCodeExporter closed 8 years ago
Can you give me specifics on the version of PHP you're seeing this on. With my
version of php I do see the
brackets encoded (as they should be). I hope this isn't a change in a newer
version of php.
I'm testing against :
PHP 5.2.4-2ubuntu5.7 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21 2009
22:17:39)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
Simple test script:
{{{
<?php
$params = array(
'facet.field' => array(
'one',
'two',
'three'
)
);
// will output
facet.field%5B0%5D=one&facet.field%5B1%5D=two&facet.field%5B2%5D=three
echo http_build_query($params), "\n";
?>
}}}
Original comment by donovan....@gmail.com
on 18 Nov 2009 at 5:46
Ah, a quick look at the php manual page:
http://us3.php.net/manual/en/function.http-build-query.php
as of version 5.1.3 all square brackets are escaped properly. So I'm guessing
you're using a version previous to
that and the json pecl extension.?
I could put a version check in to use the modified regex for older php versions.
Original comment by donovan....@gmail.com
on 18 Nov 2009 at 5:51
Hi, yes, older php version issue and not code issue - but version check would be
good. cheers.
Original comment by orangele...@gmail.com
on 18 Nov 2009 at 6:51
Fixed in r23
Original comment by donovan....@gmail.com
on 21 Nov 2009 at 2:03
Original issue reported on code.google.com by
orangele...@gmail.com
on 18 Nov 2009 at 5:25