Permalink
Browse files

Fixed #2591

  • Loading branch information...
1 parent eefde54 commit 76cfd3951484868a9ba87ce31f341e7a88e77fc9 @vantienvnn vantienvnn committed Feb 22, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 cake/libs/controller/components/cookie.php
@@ -425,20 +425,22 @@ function __decrypt($values) {
if (is_array($value)) {
foreach ($value as $key => $val) {
$pos = strpos($val, 'Q2FrZQ==.');
- $decrypted[$name][$key] = $this->__explode($val);
if ($pos !== false) {
$val = substr($val, 8);
$decrypted[$name][$key] = $this->__explode(Security::$type(base64_decode($val), $this->key));
+ } else {
+ $decrypted[$name][$key] = $this->__explode($val);
}
}
} else {
$pos = strpos($value, 'Q2FrZQ==.');
- $decrypted[$name] = $this->__explode($value);
if ($pos !== false) {
$value = substr($value, 8);
$decrypted[$name] = $this->__explode(Security::$type(base64_decode($value), $this->key));
+ } else {
+ $decrypted[$name] = $this->__explode($value);
}
}
}

0 comments on commit 76cfd39

Please sign in to comment.