Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobocoder <anthon.pang@gmail.com>2010-12-22 09:39:46 +0300
committerrobocoder <anthon.pang@gmail.com>2010-12-22 09:39:46 +0300
commit6d8c0696894002cfd877a3c51481a1aee7a1f532 (patch)
treeaf5a583e1abcdd125074f87f531881b128adfb41 /core/Cookie.php
parentbccd704f612595a4ac2920d31d844f6875f19142 (diff)
refs #1900, fixes #1911
git-svn-id: http://dev.piwik.org/svn/trunk@3508 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Cookie.php')
-rw-r--r--core/Cookie.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/core/Cookie.php b/core/Cookie.php
index 105196fa69..4b27163e8b 100644
--- a/core/Cookie.php
+++ b/core/Cookie.php
@@ -226,7 +226,15 @@ class Piwik_Cookie
// no numeric value are base64 encoded so we need to decode them
if(!is_numeric($varValue))
{
- $varValue = json_decode(base64_decode($varValue), $assoc = true);
+ // @see http://bugs.php.net/38680
+ if(PHP_VERSION == '5.2.0')
+ {
+ $varValue = safe_unserialize(base64_decode($varValue));
+ }
+ else
+ {
+ $varValue = json_decode(base64_decode($varValue), $assoc = true);
+ }
}
$this->value[$varName] = $varValue;
@@ -246,7 +254,15 @@ class Piwik_Cookie
{
if(!is_numeric($value))
{
- $value = base64_encode(json_encode($value));
+ // @see http://bugs.php.net/38680
+ if(PHP_VERSION == '5.2.0')
+ {
+ $value = base64_encode(safe_serialize($value));
+ }
+ else
+ {
+ $value = base64_encode(json_encode($value));
+ }
}
$cookieStr .= "$name=$value" . self::VALUE_SEPARATOR;