diff --git a/Smarty.class.php b/Smarty.class.php index b2dac1c4..ccc2bb8d 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -95,7 +95,8 @@ class Smarty var $caching = false; // enable caching. true/false default false. var $cache_dir = 'cache'; // name of directory for template cache files var $cache_lifetime = 3600; // number of seconds cached content will persist. - // 0 = never expires. default is one hour (3600) + // 0 = always regenerate cache, + // -1 = never expires. default is one hour (3600) var $cache_handler_func = null; // function used for cached content. this is // an alternative to using the built-in file // based caching. @@ -1478,7 +1479,7 @@ function _run_insert_handler($args) $this->_cache_info = unserialize($cache_header); - if ($this->cache_lifetime < 0 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { + if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { // cache expired, regenerate return false; } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b2dac1c4..ccc2bb8d 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -95,7 +95,8 @@ class Smarty var $caching = false; // enable caching. true/false default false. var $cache_dir = 'cache'; // name of directory for template cache files var $cache_lifetime = 3600; // number of seconds cached content will persist. - // 0 = never expires. default is one hour (3600) + // 0 = always regenerate cache, + // -1 = never expires. default is one hour (3600) var $cache_handler_func = null; // function used for cached content. this is // an alternative to using the built-in file // based caching. @@ -1478,7 +1479,7 @@ function _run_insert_handler($args) $this->_cache_info = unserialize($cache_header); - if ($this->cache_lifetime < 0 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { + if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { // cache expired, regenerate return false; } diff --git a/libs/plugins/modifier.strip_tags.php b/libs/plugins/modifier.strip_tags.php index 46a3d384..28cf48a4 100644 --- a/libs/plugins/modifier.strip_tags.php +++ b/libs/plugins/modifier.strip_tags.php @@ -8,12 +8,12 @@ * Purpose: strip html tags from text * ------------------------------------------------------------- */ -function smarty_modifier_strip_tags($string, $replace_with_space = true) +function smarty_modifier_strip_tags($string, $replace_with_space = true, $allowed = "
") { if ($replace_with_space) return preg_replace('!<[^>]*?>!', ' ', $string); else - return strip_tags($string); + return strip_tags($string, $allowed); } /* vim: set expandtab: */ diff --git a/plugins/modifier.strip_tags.php b/plugins/modifier.strip_tags.php index 46a3d384..28cf48a4 100644 --- a/plugins/modifier.strip_tags.php +++ b/plugins/modifier.strip_tags.php @@ -8,12 +8,12 @@ * Purpose: strip html tags from text * ------------------------------------------------------------- */ -function smarty_modifier_strip_tags($string, $replace_with_space = true) +function smarty_modifier_strip_tags($string, $replace_with_space = true, $allowed = "
") { if ($replace_with_space) return preg_replace('!<[^>]*?>!', ' ', $string); else - return strip_tags($string); + return strip_tags($string, $allowed); } /* vim: set expandtab: */