From 76bb51117423afc67fb10412201b6715d7ffd68b Mon Sep 17 00:00:00 2001 From: Alex Pott Date: Thu, 6 Dec 2018 11:34:43 +0100 Subject: [PATCH] Issue #3017753 by mxr576, alexpott: MemoryBackend should validate the passed cids --- core/lib/Drupal/Core/Cache/MemoryBackend.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/Drupal/Core/Cache/MemoryBackend.php b/core/lib/Drupal/Core/Cache/MemoryBackend.php index 09454d78505f..c1276923754b 100644 --- a/core/lib/Drupal/Core/Cache/MemoryBackend.php +++ b/core/lib/Drupal/Core/Cache/MemoryBackend.php @@ -156,7 +156,8 @@ class MemoryBackend implements CacheBackendInterface, CacheTagsInvalidatorInterf * {@inheritdoc} */ public function invalidateMultiple(array $cids) { - foreach ($cids as $cid) { + $items = array_intersect_key($this->cache, array_flip($cids)); + foreach ($items as $cid => $item) { $this->cache[$cid]->expire = $this->getRequestTime() - 1; } }