Avoid infinite recursion when expiring cache. fixes #1875
git-svn-id: http://svn.automattic.com/wordpress/trunk@3086 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1bf946e618
commit
60d04abb0c
|
@ -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