- 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)
- improvment remove unneeded assigments (Issue 75 and 76)
- 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
- 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]);
}
}
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);
}
// 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);
}
}
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);
}
if (isset($this->error_reporting)) {
@@ -429,7 +429,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} else {
$this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
}
return $this;
}
@@ -445,7 +445,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_plugins[$type][$tag])) {
unset($this->smarty->registered_plugins[$type][$tag]);
}
return $this;
}
@@ -473,7 +473,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_resources[$type])) {
unset($this->smarty->registered_resources[$type]);
}
return $this;
}
@@ -501,7 +501,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_cache_resources[$type])) {
unset($this->smarty->registered_cache_resources[$type]);
}
return $this;
}
@@ -570,7 +570,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_objects[$name])) {
unset($this->smarty->registered_objects[$name]);
}
return $this;
}
@@ -607,7 +607,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} else {
throw new SmartyException("Default plugin handler '$callback' not callable");
}
return $this;
}
@@ -625,7 +625,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} else {
throw new SmartyException("Default template handler '$callback' not callable");
}
return $this;
}
@@ -643,7 +643,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
} else {
throw new SmartyException("Default config handler '$callback' not callable");
}
return $this;
}
@@ -673,7 +673,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_filters[$type][$name])) {
unset($this->smarty->registered_filters[$type][$name]);
}
return $this;
}
@@ -730,7 +730,7 @@ abstract class Smarty_Internal_TemplateBase extends Smarty_Internal_Data {
if (isset($this->smarty->registered_filters[$type][$_filter_name])) {
unset ($this->smarty->registered_filters[$type][$_filter_name]);
}
return $this;
}