Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Flood / MemoryBackend.php
index ddb42bc4cd6fd5e5d5e6a28529f7178d212afd4a..9899e35e7ee1ac012b163b8f50f7850ea1dc16d2 100644 (file)
@@ -61,6 +61,9 @@ class MemoryBackend implements FloodInterface {
     if (!isset($identifier)) {
       $identifier = $this->requestStack->getCurrentRequest()->getClientIp();
     }
+    if (!isset($this->events[$name][$identifier])) {
+      return $threshold > 0;
+    }
     $limit = microtime(TRUE) - $window;
     $number = count(array_filter($this->events[$name][$identifier], function ($timestamp) use ($limit) {
       return $timestamp > $limit;