Skip to content

Commit

Permalink
fix invalid cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Apr 4, 2024
1 parent ff48e51 commit 8d8d50b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/SparkPostAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 8d8d50b

Please sign in to comment.