From 9cdf68807f607a6efd627fd5d372dd27a796f05c Mon Sep 17 00:00:00 2001 From: uwetews Date: Sat, 19 Dec 2015 21:37:46 +0100 Subject: [PATCH] - improvement make sure that compiled and cache templates never can contain a trailing '?>? --- change_log.txt | 1 + libs/sysplugins/smarty_internal_runtime_codeframe.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/change_log.txt b/change_log.txt index cc1c32d3..73ea00d4 100644 --- a/change_log.txt +++ b/change_log.txt @@ -3,6 +3,7 @@ - bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138 - bugfix broken PHP 5.2 compatibility - remove no longer used code + - improvement make sure that compiled and cache templates never can contain a trailing '?>? 18.12.2015 - bugfix regression when modifier parameter was follow by math https://github.com/smarty-php/smarty/issues/132 diff --git a/libs/sysplugins/smarty_internal_runtime_codeframe.php b/libs/sysplugins/smarty_internal_runtime_codeframe.php index 21e6e522..ce674977 100644 --- a/libs/sysplugins/smarty_internal_runtime_codeframe.php +++ b/libs/sysplugins/smarty_internal_runtime_codeframe.php @@ -89,6 +89,6 @@ class Smarty_Internal_Runtime_CodeFrame $output .= $functions; $output .= "[\n]?<\?php\s*/', "\n", $output); + return preg_replace(array('/\s*\?>[\n]?<\?php\s*/', '/\?>\s*$/'), array("\n", ''), $output); } } \ No newline at end of file