X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache%2FArrayDecorator.php;h=86ac79728a52e65ffbe3ed41308d3c14ecc27033;hb=701fd7a63eb4b10a6b91a91c0c05dba1bbaf8b69;hp=b3c7e091c3e4cb1fa8f5aaa75f0c432eb038e4fa;hpb=c0d2d04a5a34e8c68d5764380dcc79dbe948ea7d;p=civicrm-core.git diff --git a/CRM/Utils/Cache/ArrayDecorator.php b/CRM/Utils/Cache/ArrayDecorator.php index b3c7e091c3..86ac79728a 100644 --- a/CRM/Utils/Cache/ArrayDecorator.php +++ b/CRM/Utils/Cache/ArrayDecorator.php @@ -41,7 +41,8 @@ */ class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface { - use CRM_Utils_Cache_NaiveMultipleTrait; // TODO Consider native implementation. + // TODO Consider native implementation. + use CRM_Utils_Cache_NaiveMultipleTrait; /** * @var int @@ -94,6 +95,7 @@ class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface { } public function get($key, $default = NULL) { + CRM_Utils_Cache::assertValidKey($key); if (array_key_exists($key, $this->values) && $this->expires[$key] > CRM_Utils_Time::getTimeRaw()) { return $this->reobjectify($this->values[$key]); } @@ -110,6 +112,7 @@ class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface { } public function delete($key) { + CRM_Utils_Cache::assertValidKey($key); unset($this->values[$key]); unset($this->expires[$key]); return $this->delegate->delete($key); @@ -126,6 +129,7 @@ class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface { } public function has($key) { + CRM_Utils_Cache::assertValidKey($key); if (array_key_exists($key, $this->values) && $this->expires[$key] > CRM_Utils_Time::getTimeRaw()) { return TRUE; }