File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -129,14 +129,21 @@ public function initialize($options = array())
129129 {
130130 $ this ->data = array ();
131131 }
132- elseif (is_array ($ raw ))
133- {
134- // probably an old cached value (BC)
135- $ this ->data = $ raw ;
136- }
137132 else
138133 {
139- $ this ->data = unserialize ($ raw );
134+ $ data = @unserialize ($ raw );
135+ // We test 'b:0' special case, because such a string would result
136+ // in $data being === false, while raw is serialized
137+ // see http://stackoverflow.com/questions/1369936/check-to-see-if-a-string-is-serialized
138+ if ( $ raw === 'b:0; ' || $ data !== false )
139+ {
140+ $ this ->data = $ data ;
141+ }
142+ else
143+ {
144+ // Probably an old cached value (BC)
145+ $ this ->data = $ raw ;
146+ }
140147 }
141148
142149 if (sfConfig::get ('sf_logging_enabled ' ))
You can’t perform that action at this time.
0 commit comments