From 8d8d50b131df0edd56ca774cfa397b595fcf0830 Mon Sep 17 00:00:00 2001 From: Thomas Date: Thu, 4 Apr 2024 17:09:03 +0200 Subject: [PATCH] fix invalid cache key --- src/SparkPostAdmin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/SparkPostAdmin.php b/src/SparkPostAdmin.php index b0089f7..ced9b7a 100644 --- a/src/SparkPostAdmin.php +++ b/src/SparkPostAdmin.php @@ -456,7 +456,7 @@ protected function getCachedData($method, $params = null, $expireInSeconds = 60) $cacheResult = false; $cache = $this->getCache(); if ($enabled) { - $key = md5(serialize($params)); + $key = $method . '_' . md5(serialize($params)); $cacheResult = $cache->get($key); } if ($enabled && $cacheResult) { @@ -1027,6 +1027,10 @@ public function DomainTab() $list = new ArrayList(); if ($domains) { foreach ($domains as $domain) { + // Sometimes the api or the cache returns invalid data... + if (!is_array($domain)) { + continue; + } $list->push(new ArrayData([ 'Domain' => $domain['domain'], 'SPF' => $domain['status']['spf_status'],