Browse files

Parse cookie values "{}" & "[]" as array

  • Loading branch information...
1 parent 9d87f6f commit db63ba2d8f95e67b6b212860f0310ed65ab4db6a @luissquall luissquall committed Oct 30, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Controller/Component/CookieComponent.php
View
2 lib/Cake/Controller/Component/CookieComponent.php
@@ -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) {

0 comments on commit db63ba2

Please sign in to comment.