diff --git a/change_log.txt b/change_log.txt index 97e740ac..7e14bc27 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== +28.12.2011 +- bugfix Smarty's internal header code must be excluded from postfilters (issue 71) + 22.12.2011 - bugfix the new lexer of 17.12.2011 did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680) - bugfix template inheritace did fail if mbstring.func_overload != 0 (issue 70) (Forum Topic 20680) diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 1f50be75..a8f4eace 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -176,20 +176,24 @@ abstract class Smarty_Internal_TemplateCompilerBase { self::$_tag_objects = array(); // return compiled code to template object $merged_code = ''; - if (!$this->suppressMergedTemplates) { + if (!$this->suppressMergedTemplates && !empty($this->merged_templates)) { foreach ($this->merged_templates as $code) { $merged_code .= $code; } + // run postfilter if required on merged code + if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) { + $merged_code = Smarty_Internal_Filter_Handler::runFilter('post', $merged_code, $template); + } + } + // run postfilter if required on compiled template code + if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) { + $_compiled_code = Smarty_Internal_Filter_Handler::runFilter('post', $_compiled_code, $template); } if ($this->suppressTemplatePropertyHeader) { $code = $_compiled_code . $merged_code; } else { $code = $template_header . $template->createTemplateCodeFrame($_compiled_code) . $merged_code; } - // run postfilter if required - if (isset($this->smarty->autoload_filters['post']) || isset($this->smarty->registered_filters['post'])) { - $code = Smarty_Internal_Filter_Handler::runFilter('post', $code, $template); - } return $code; }