- bugfix output filter must not run before writing cache when template does contain nocache code {Issue 71}

This commit is contained in:
uwe.tews@googlemail.com
2012-01-20 18:21:32 +00:00
parent 1e2fb8fbbe
commit d8b26c5ad0
2 changed files with 13 additions and 12 deletions

View File

@@ -3,6 +3,7 @@
- bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74) - bugfix typo in Smarty_Internal_Get_IncludePath did cause runtime overhead (Issue 74)
- improvment remove unneeded assigments (Issue 75 and 76) - improvment remove unneeded assigments (Issue 75 and 76)
- fixed typo in template parser - fixed typo in template parser
- bugfix output filter must not run before writing cache when template does contain nocache code {Issue 71}
02.01.2012 02.01.2012
- bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753) - bugfix {block foo nocache} did not load plugins within child {block} in nocache mode (Forum Topic 20753)

View File

@@ -242,7 +242,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
$output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]); $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
} }
} }
if (!$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) { if (!$no_output_filter && !$_template->has_nocache_code && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
$output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template); $output = Smarty_Internal_Filter_Handler::runFilter('output', $output, $_template);
} }
// rendering (must be done before writing cache file because of {function} nocache handling) // rendering (must be done before writing cache file because of {function} nocache handling)
@@ -293,7 +293,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
Smarty_Internal_Debug::end_cache($_template); Smarty_Internal_Debug::end_cache($_template);
} }
} }
if ((!$this->caching || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) { if ((!$this->caching || $_template->has_nocache_code || $_template->source->recompiled) && !$no_output_filter && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
$_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template); $_output = Smarty_Internal_Filter_Handler::runFilter('output', $_output, $_template);
} }
if (isset($this->error_reporting)) { if (isset($this->error_reporting)) {