projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #15248 from MegaphoneJon/reporting-19
[civicrm-core.git]
/
CRM
/
Utils
/
Cache
/
ArrayDecorator.php
diff --git
a/CRM/Utils/Cache/ArrayDecorator.php
b/CRM/Utils/Cache/ArrayDecorator.php
index b3c7e091c3e4cb1fa8f5aaa75f0c432eb038e4fa..c0b36a01bbf1493b7d747905eb321a0c01a83f2b 100644
(file)
--- a/
CRM/Utils/Cache/ArrayDecorator.php
+++ b/
CRM/Utils/Cache/ArrayDecorator.php
@@
-3,7
+3,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-20
19
|
+ | Copyright CiviCRM LLC (c) 2004-20
20
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-28,7
+28,7
@@
/**
*
* @package CRM
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-20
19
+ * @copyright CiviCRM LLC (c) 2004-20
20
*/
/**
*/
/**
@@
-41,7
+41,8
@@
*/
class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface {
*/
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
/**
* @var int
@@
-94,6
+95,7
@@
class CRM_Utils_Cache_ArrayDecorator implements CRM_Utils_Cache_Interface {
}
public function get($key, $default = NULL) {
}
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]);
}
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) {
}
public function delete($key) {
+ CRM_Utils_Cache::assertValidKey($key);
unset($this->values[$key]);
unset($this->expires[$key]);
return $this->delegate->delete($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) {
}
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;
}
if (array_key_exists($key, $this->values) && $this->expires[$key] > CRM_Utils_Time::getTimeRaw()) {
return TRUE;
}