the module had a call to json_encode() :
$options[] = "['options', " . json_encode($params['options'], JSON_NUMERIC_CHECK) . "]";
the 2nd parameter to json_encode() was not added until PHP 5.3 and JSON_NUMERIC_CHECK particularly was not added until PHP 5.3.3 - see http://php.net/json_encode. so on sites running older versions of PHP, not only is that type checking not happening, but there is a PHP error on the function call.
i added code to simulate the effect, setting the value to float or int as applicable.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | kissinsights-php_pre_533_compatibility-1443600-2.patch | 490 bytes | esbenvb |
| kissinsights.json_encode.patch | 1.16 KB | brad.bulger |
Comments
Comment #1
notzach commentedTested the patch out on a box running php 5.2.17 and I haven't had any issues yet.
Comment #2
esbenvb commentedThis patch should also work with PHP < 5.3.3, and performs better :)
Comment #3
esbenvb commented