From 57f44554375a38209abe515cfe7919493aff16d2 Mon Sep 17 00:00:00 2001 From: catch Date: Tue, 27 Sep 2011 22:14:28 +0900 Subject: [PATCH] Issue #1244296 by das-peter: fix strict warning from reset(). --- memcache.inc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/memcache.inc b/memcache.inc index 443e57e..78ed418 100644 --- a/memcache.inc +++ b/memcache.inc @@ -296,7 +296,11 @@ class MemCacheDrupal implements DrupalCacheInterface { } if ($flush) { - $key_length = isset($this->wildcard_flushes[$this->bin]) ? strlen(reset(array_keys($this->wildcard_flushes[$this->bin]))) : $length; + $key_length = $length; + if (isset($this->wildcard_flushes[$this->bin])) { + $keys = array_keys($this->wildcard_flushes[$this->bin]); + $key_length = strlen(reset($keys)); + } $key = substr($cid, 0, $key_length); // Avoid too many calls to variable_set() by only recording a flush for // a fraction of the wildcard invalidation variable, per cid length. -- GitLab