From f3dfdc5ec1433bb01cd4c18535f16a352c12f5f3 Mon Sep 17 00:00:00 2001 From: mohrt Date: Sat, 26 Apr 2003 15:56:18 +0000 Subject: [PATCH] remove unnecessary close/open tags from compiled templates --- NEWS | 2 ++ libs/Smarty_Compiler.class.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/NEWS b/NEWS index b6f76e7d..e5ae5b6f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,5 @@ + - remove unnecessary close/open tags from compiled templates + (Monte) - fixed errornous creation of '//' in image_path in html_image (messju) - fix escapement of special chars for key vals in debug console (Monte) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 9ef3c717..bd24ce79 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -316,6 +316,9 @@ class Smarty_Compiler extends Smarty { $template_compiled = substr($template_compiled, 0, -1); } + // remove unnecessary close/open tags + $template_compiled = preg_replace('!\?>\n?<\?php!', '', $template_compiled); + // run compiled template through postfilter functions if (count($this->_plugins['postfilter']) > 0) { foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {