From 0d0a6b876df965b431c21eae13d48e748f70b8dd Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 14 Jan 2006 21:22:48 +0000 Subject: [PATCH] Disable peristent cache when safe_mode. git-svn-id: https://develop.svn.wordpress.org/trunk@3436 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/cache.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/cache.php b/wp-includes/cache.php index a0e6633746..7ad6422821 100644 --- a/wp-includes/cache.php +++ b/wp-includes/cache.php @@ -396,6 +396,10 @@ class WP_Object_Cache { if (defined('DISABLE_CACHE')) return; + // Disable the persistent cache if safe_mode is on. + if ( ini_get('safe_mode') ) + return; + if (defined('CACHE_PATH')) $this->cache_dir = CACHE_PATH; else @@ -403,10 +407,11 @@ class WP_Object_Cache { if (is_writable($this->cache_dir) && is_dir($this->cache_dir)) { $this->cache_enabled = true; - } else + } else { if (is_writable(ABSPATH.'wp-content')) { $this->cache_enabled = true; } + } if (defined('CACHE_EXPIRATION_TIME')) $this->expiration_time = CACHE_EXPIRATION_TIME;