From 04cd1038dba025716a3f03f6dd276e7ab920d839 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 5 Jan 2006 04:50:58 +0000 Subject: [PATCH] Don't remove top level cache dir when flushing. git-svn-id: https://develop.svn.wordpress.org/trunk@3402 602fd350-edb4-49c9-b593-d223f7449a82 --- 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); } }