Closed GoogleCodeExporter closed 8 years ago
Original comment by ever...@fireproofsocks.com
on 26 May 2014 at 9:32
opk, further investigation. It's not the version of CCTM, it's the version of
PHP
PHP Version 5.3.10-1ubuntu3.8
var_dump of json_decode("2014-04-27",true) is NULL
This works, since the code determines it is not valid JSON, and just returns
the string.
However:
PHP Version 5.5.9-1ubuntu4
var_dump of json_decode("2014-04-27",true) is int(2014)
fails, because the result is not void, it assumes it's a multi, and the date
will display as today's date.
The calls that are affected by this that I have found so far are on:
Line 82 of includes/CCTM_OutputFilter.php
Line 673 of includes/CCTM_FormElement.php
I fixed them in my instance by only doing the json_decode if it looks like a
json string...
if (!is_array($str)) {
$firstChar = mb_substr($str, 0, 1, 'utf-8'); // Simon Added
if ($firstChar == '{' || $firstChar == '[') { // Simon Added
$out = (array) json_decode($str, true);
} // Simon Added
}
Original comment by mrfantsy...@gmail.com
on 28 May 2014 at 5:34
Fixed in Git repo: 2796b9f..9dfda5e master -> master
Original comment by ever...@fireproofsocks.com
on 11 May 2015 at 5:28
Issue 563 has been merged into this issue.
Original comment by ever...@fireproofsocks.com
on 11 May 2015 at 5:31
Original issue reported on code.google.com by
mrfantsy...@gmail.com
on 26 May 2014 at 8:27