From 78de29b7ce5b8c1c34749bb68813840f7e6c4b7b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:39:45 +0100 Subject: [PATCH] [ticket/10614] Check if cache exists before destroying it PHPBB3-10614 --- phpBB/includes/extension/manager.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 12b626d69f..56092410f2 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -167,7 +167,10 @@ class phpbb_extension_manager $this->db->sql_query($sql); } - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return !$active; } @@ -221,7 +224,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return true; } @@ -238,7 +244,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return false; } @@ -298,7 +307,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return true; } @@ -309,7 +321,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return false; }