diff --git a/lib/storage/sfCacheSessionStorage.class.php b/lib/storage/sfCacheSessionStorage.class.php index 00d602b12..eeedc8e68 100644 --- a/lib/storage/sfCacheSessionStorage.class.php +++ b/lib/storage/sfCacheSessionStorage.class.php @@ -129,14 +129,21 @@ public function initialize($options = array()) { $this->data = array(); } - elseif (is_array($raw)) - { - // probably an old cached value (BC) - $this->data = $raw; - } else { - $this->data = unserialize($raw); + $data = @unserialize($raw); + // We test 'b:0' special case, because such a string would result + // in $data being === false, while raw is serialized + // see http://stackoverflow.com/questions/1369936/check-to-see-if-a-string-is-serialized + if ( $raw === 'b:0;' || $data !== false) + { + $this->data = $data; + } + else + { + // Probably an old cached value (BC) + $this->data = $raw; + } } if(sfConfig::get('sf_logging_enabled'))