From 49a3427515999f4fb39d5cd916bcb907f3c309b4 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Sat, 27 Dec 2014 23:06:04 +0100 Subject: [PATCH] clear internal _is_file_cache when plugins_dir was modified --- change_log.txt | 3 +++ libs/Smarty.class.php | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/change_log.txt b/change_log.txt index 0fc34ed5..f5c8c7ce 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== 3.1.22-dev ===== (xx.xx.2014) + 27.12.2014 + - bugfix clear internal _is_file_cache when plugins_dir was modified + 13.12.2014 - improvement optimization of lexer and parser resulting in a up to 30% higher compiling speed diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 4aa9e5f8..fa2ddffe 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -650,7 +650,7 @@ class Smarty extends Smarty_Internal_TemplateBase * * @var array */ - public static $_is_file_cache = array(); + public $_is_file_cache = array(); /**#@-*/ @@ -1041,7 +1041,7 @@ class Smarty extends Smarty_Internal_TemplateBase foreach ((array) $plugins_dir as $k => $v) { $this->plugins_dir[$k] = rtrim($v, '/\\') . DS; } - + $this->_is_file_cache = array(); return $this; } @@ -1073,7 +1073,7 @@ class Smarty extends Smarty_Internal_TemplateBase } $this->plugins_dir = array_unique($this->plugins_dir); - + $this->_is_file_cache = array(); return $this; } @@ -1374,7 +1374,7 @@ class Smarty extends Smarty_Internal_TemplateBase // if type is "internal", get plugin from sysplugins if (strtolower($_name_parts[1]) == 'internal') { $file = SMARTY_SYSPLUGINS_DIR . strtolower($plugin_name) . '.php'; - if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) { + if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) { require_once($file); return $file; } else { @@ -1393,7 +1393,7 @@ class Smarty extends Smarty_Internal_TemplateBase $_plugin_dir . strtolower($_plugin_filename), ); foreach ($names as $file) { - if (isset(self::$_is_file_cache[$file]) ? self::$_is_file_cache[$file] : self::$_is_file_cache[$file] = is_file($file)) { + if (isset($this->_is_file_cache[$file]) ? $this->_is_file_cache[$file] : $this->_is_file_cache[$file] = is_file($file)) { require_once($file); return $file; }