From 5166e06e08a3e2aa016857fe35c402f897db43aa Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 4 May 2017 13:09:13 +0800 Subject: [PATCH] MDL-56675 cachestore_memcached: Check all connected servers for support --- cache/stores/memcached/lib.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cache/stores/memcached/lib.php b/cache/stores/memcached/lib.php index e8a29eb58b7..5e0077a79d4 100644 --- a/cache/stores/memcached/lib.php +++ b/cache/stores/memcached/lib.php @@ -261,9 +261,13 @@ class cachestore_memcached extends cache_store implements cache_is_configurable $safecombination = true; } - if (!$safecombination && (version_compare($this->connection->getVersion(), '1.4.22') <= 0)) { - // This is memcached server version <= 1.4.22 which is a safe combination. - $safecombination = true; + if (!$safecombination) { + $allsafe = true; + foreach ($this->connection->getVersion() as $version) { + $allsafe = $allsafe && (version_compare($version, '1.4.22') <= 0); + } + // All memcached servers connected are version <= 1.4.22 which is a safe combination. + $safecombination = $allsafe; } if (!$safecombination) {