Skip to content

Commit

Permalink
Make code in 1.3 the same as 2.0
Browse files Browse the repository at this point in the history
Fixes #2561
  • Loading branch information
markstory committed Feb 11, 2012
1 parent 6237111 commit 52f4b08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cake/libs/controller/components/cookie.php
Expand Up @@ -468,7 +468,8 @@ function __implode($array) {
* @access private
*/
function __explode($string) {
if (!empty($string[0]) && ($string[0] === '{' || $string[0] === '[') && function_exists('json_decode')) {
$first = substr($string, 0, 1);
if ($first !== false && ($first === '{' || $first === '[') && function_exists('json_decode')) {
$ret = json_decode($string, true);
return ($ret != null) ? $ret : $string;
}
Expand Down

0 comments on commit 52f4b08

Please sign in to comment.