mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 19:50:14 +01:00
MDL-63127 cachestore_redis: add check before using igbinary_serialize
Redis::SERIALIZER_IGBINARY is undefined if redis is not compiled with this option.
This commit is contained in:
parent
54a659a5bd
commit
3ad56eee9f
4
cache/stores/redis/lib.php
vendored
4
cache/stores/redis/lib.php
vendored
@ -649,7 +649,7 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_
|
||||
return $value;
|
||||
case Redis::SERIALIZER_PHP:
|
||||
return serialize($value);
|
||||
case Redis::SERIALIZER_IGBINARY:
|
||||
case defined('Redis::SERIALIZER_IGBINARY') && Redis::SERIALIZER_IGBINARY:
|
||||
return igbinary_serialize($value);
|
||||
default:
|
||||
debugging("Invalid serializer: {$this->serializer}");
|
||||
@ -669,7 +669,7 @@ class cachestore_redis extends cache_store implements cache_is_key_aware, cache_
|
||||
return $value;
|
||||
case Redis::SERIALIZER_PHP:
|
||||
return unserialize($value);
|
||||
case Redis::SERIALIZER_IGBINARY:
|
||||
case defined('Redis::SERIALIZER_IGBINARY') && Redis::SERIALIZER_IGBINARY:
|
||||
return igbinary_unserialize($value);
|
||||
default:
|
||||
debugging("Invalid serializer: {$this->serializer}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user