-change run output filter before cache file is written (as in Smarty2)

This commit is contained in:
uwe.tews@googlemail.com
2010-11-27 15:05:38 +00:00
parent 2e1c83f44d
commit e80dd75958
4 changed files with 7 additions and 2 deletions

View File

@@ -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

View File

@@ -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();

View File

@@ -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;
}

View File

@@ -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();