Avoid infinite recursion when expiring cache. fixes #1875
git-svn-id: https://develop.svn.wordpress.org/trunk@3086 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
749abafaae
commit
aedbd711b2
@ -75,11 +75,11 @@ class WP_Object_Cache {
|
||||
return $this->set($id, $data, $group, $expire);
|
||||
}
|
||||
|
||||
function delete($id, $group = 'default') {
|
||||
function delete($id, $group = 'default', $force = false) {
|
||||
if ( empty($group) )
|
||||
$group = 'default';
|
||||
|
||||
if ( false === $this->get($id, $group, false) )
|
||||
if ( !$force && false === $this->get($id, $group, false) )
|
||||
return false;
|
||||
|
||||
unset ($this->cache[$group][$id]);
|
||||
@ -128,7 +128,7 @@ class WP_Object_Cache {
|
||||
$now = time();
|
||||
if ( (filemtime($cache_file) + $this->expiration_time) <= $now ) {
|
||||
$this->cache_misses += 1;
|
||||
$this->delete($id, $group);
|
||||
$this->delete($id, $group, true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user