diff --git a/change_log.txt b/change_log.txt index 3d372280..7619934c 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,6 @@ ===== SVN trunk ===== +27/11/2010 +-change run output filter before cache file is written. (same as in Smarty2) 24/11/2011 -bugfix on parser at !$foo|modifier diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index a0bb4ed4..31909663 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -329,7 +329,7 @@ class Smarty extends Smarty_Internal_Data { } } // return redered template - if (isset($this->autoload_filters['output']) || isset($this->registered_filters['output'])) { + if ((!$this->caching || $_template->resource_object->isEvaluated) && (isset($this->autoload_filters['output']) || isset($this->registered_filters['output']))) { $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_template->getRenderedTemplate(), $_template); } else { $_output = $_template->getRenderedTemplate(); diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index d165d7d7..5e586547 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -103,7 +103,7 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data { $_template->assign('assigned_vars', $_assigned_vars); $_template->assign('config_vars', $_config_vars); $_template->assign('execution_time', microtime(true) - $smarty->start_time); - echo $smarty->fetch($_template); + echo $_template->getRenderedTemplate(); $smarty->left_delimiter = $ldelim; $smarty->right_delimiter = $rdelim; } diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 94f2deb9..d361b4c6 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -500,6 +500,9 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { $output .= preg_replace("!/\*/?%%SmartyNocache:{$this->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]); } } + if (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output'])) { + $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $this); + } // rendering (must be done before writing cache file because of {function} nocache handling) $_smarty_tpl = $this; ob_start();