mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Strict type check for null cache values
Previously, generated cache results that returned 0, '', array() etc were being ignored. This change narrows it down to just false. Ideally we would use a EmptyCacheHit object to be very specific for these cases, but perhaps this approach is a bit overkill.
This commit is contained in:
parent
723c4e3f4e
commit
ceab35a0be
@ -1077,10 +1077,12 @@ abstract class Object {
|
||||
if($ID) $cacheName .= '_' . $ID;
|
||||
if(count($arguments)) $cacheName .= '_' . md5(serialize($arguments));
|
||||
|
||||
if($data = $this->loadCache($cacheName, $lifetime)) {
|
||||
$data = $this->loadCache($cacheName, $lifetime);
|
||||
|
||||
if($data !== false) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
$data = call_user_func_array(array($this, $method), $arguments);
|
||||
$this->saveCache($cacheName, $data);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user