check for php serialization before using igbinary_unserialize

This commit is contained in:
Ralf Becker 2016-02-29 08:45:33 +00:00
parent 86bf2fb2c0
commit d2e7c7da4d

View File

@ -122,7 +122,7 @@ class Memcache extends Base implements ProviderMultiple
return null; return null;
} }
//error_log(__METHOD__."(".array2string($keys).") key='$key' found ".bytes($data)." bytes)."); //error_log(__METHOD__."(".array2string($keys).") key='$key' found ".bytes($data)." bytes).");
return $this->igbinary_available ? igbinary_unserialize($data) : unserialize($data); return $this->igbinary_available && $data[1] !== ':' ? igbinary_unserialize($data) : unserialize($data);
} }
/** /**
@ -149,7 +149,7 @@ class Memcache extends Base implements ProviderMultiple
{ {
$key = substr($location,$prefix_len); $key = substr($location,$prefix_len);
//error_log(__METHOD__."(".array2string($locations).") key='$key' found ".bytes($data)." bytes)."); //error_log(__METHOD__."(".array2string($locations).") key='$key' found ".bytes($data)." bytes).");
$ret[$key] = $this->igbinary_available ? igbinary_unserialize($data) : unserialize($data); $ret[$key] = $this->igbinary_available && $data[1] !== ':' ? igbinary_unserialize($data) : unserialize($data);
} }
return $ret; return $ret;
} }