From 05188cd4a01c795db67b1d43cc801004563b0590 Mon Sep 17 00:00:00 2001 From: ryan Date: Thu, 5 Jan 2006 04:50:58 +0000 Subject: [PATCH] Don't remove top level cache dir when flushing. git-svn-id: http://svn.automattic.com/wordpress/trunk@3402 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/cache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index 6b9f17cb15..dfe73f7298 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -217,6 +217,7 @@ class WP_Object_Cache { function rm_cache_dir() { $dir = $this->cache_dir; $dir = rtrim($dir, DIRECTORY_SEPARATOR); + $top_dir = $dir; $stack = array($dir); while (count($stack)) { @@ -238,7 +239,8 @@ class WP_Object_Cache { } if (end($stack) == $dir) { - @ rmdir($dir); + if ( $dir != $top_dir) + @ rmdir($dir); array_pop($stack); } }