From 60d04abb0c99c05fc7f5c3eb06973f90fc328f41 Mon Sep 17 00:00:00 2001 From: ryan Date: Mon, 14 Nov 2005 21:29:30 +0000 Subject: [PATCH] Avoid infinite recursion when expiring cache. fixes #1875 git-svn-id: http://svn.automattic.com/wordpress/trunk@3086 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/cache.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index ca1e1e4780..672380709e 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -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; }