diff options
author | robocoder <anthon.pang@gmail.com> | 2009-12-14 00:25:01 +0300 |
---|---|---|
committer | robocoder <anthon.pang@gmail.com> | 2009-12-14 00:25:01 +0300 |
commit | 7b572d45aaad7a441f03d54c76faa7c641e55a77 (patch) | |
tree | 0cfcbdb32de3c0f4496edab071dd65a6072973c9 /core/Cookie.php | |
parent | 4fdf12bf7e2fdaee05e47e7b95fd1c346bc549c3 (diff) |
refactor unserialize_array(); add Application version tests to SecurityInfo
git-svn-id: http://dev.piwik.org/svn/trunk@1682 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Cookie.php')
-rw-r--r-- | core/Cookie.php | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/core/Cookie.php b/core/Cookie.php index 4868d5d1f5..c688cf09eb 100644 --- a/core/Cookie.php +++ b/core/Cookie.php @@ -164,7 +164,7 @@ class Piwik_Cookie $varValue = base64_decode($varValue); // some of the values may be serialized array so we try to unserialize it - $varValue = self::unserialize_array($varValue); + $varValue = Piwik_Common::unserialize_array($varValue); } $this->set($varName, $varValue); @@ -258,28 +258,4 @@ class Piwik_Cookie { return Piwik_Common::sanitizeInputValues($value); } - - /** - * Unserialize (serialized) array - * - * @param string - * @return array or original string if not unserializable - */ - public static function unserialize_array( $str ) - { - // we set the unserialized version only for arrays as you can have set a serialized string on purpose - if (preg_match('/^a:[0-9]+:{/', $str) - && !preg_match('/(^|;|{|})O:[0-9]+:"/', $str) - && strpos($str, "\0") === false) - { - if( ($arrayValue = @unserialize($str)) !== false - && is_array($arrayValue) ) - { - return $arrayValue; - } - } - - // return original string - return $str; - } } |