Skip to content

Commit

Permalink
Parse cookie values "{}" & "[]" as array
Browse files Browse the repository at this point in the history
  • Loading branch information
luissquall committed Oct 30, 2013
1 parent 9d87f6f commit db63ba2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Cake/Controller/Component/CookieComponent.php
Expand Up @@ -534,7 +534,7 @@ protected function _explode($string) {
$first = substr($string, 0, 1);
if ($first === '{' || $first === '[') {
$ret = json_decode($string, true);
return ($ret) ? $ret : $string;
return ($ret !== null) ? $ret : $string;
}
$array = array();
foreach (explode(',', $string) as $pair) {
Expand Down

0 comments on commit db63ba2

Please sign in to comment.