cvs: smarty / Smarty.class.php /plugins modifier.strip_tags.php

From: Date: Fri, 12 Apr 2002 14:41:04 +0000
Subject: cvs: smarty / Smarty.class.php /plugins modifier.strip_tags.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-45@lists.php.net to get a copy of this message
mohrt Fri Apr 12 10:41:04 2002 EDT Modified files: /smarty Smarty.class.php /smarty/plugins modifier.strip_tags.php Log: update cache_lifetime logic: -1 = never expire, 0 = always expire Index: smarty/Smarty.class.php diff -u smarty/Smarty.class.php:1.263 smarty/Smarty.class.php:1.264 --- smarty/Smarty.class.php:1.263 Thu Apr 11 16:27:04 2002 +++ smarty/Smarty.class.php Fri Apr 12 10:41:03 2002 @@ -95,7 +95,8 @@ 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 @@ $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; } Index: smarty/plugins/modifier.strip_tags.php diff -u smarty/plugins/modifier.strip_tags.php:1.1 smarty/plugins/modifier.strip_tags.php:1.2 --- smarty/plugins/modifier.strip_tags.php:1.1 Thu Jan 31 15:49:40 2002 +++ smarty/plugins/modifier.strip_tags.php Fri Apr 12 10:41:04 2002 @@ -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 = "<i><b><br>") { if ($replace_with_space) return preg_replace('!<[^>]*?>!', ' ', $string); else - return strip_tags($string); + return strip_tags($string, $allowed); } /* vim: set expandtab: */

« previous php.smarty.cvs (#45) next »