From d2e7c7da4ddcc180c27ce92d6346d2bcd3cdce2d Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 29 Feb 2016 08:45:33 +0000 Subject: [PATCH] check for php serialization before using igbinary_unserialize --- api/src/Cache/Memcache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/Cache/Memcache.php b/api/src/Cache/Memcache.php index 7c66217155..f0fe9c8865 100644 --- a/api/src/Cache/Memcache.php +++ b/api/src/Cache/Memcache.php @@ -122,7 +122,7 @@ class Memcache extends Base implements ProviderMultiple return null; } //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); //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; }