remove unnecessary close/open tags from compiled templates

This commit is contained in:
mohrt
2003-04-26 15:56:18 +00:00
parent a2550ae543
commit f3dfdc5ec1
2 changed files with 5 additions and 0 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- remove unnecessary close/open tags from compiled templates
(Monte)
- fixed errornous creation of '//' in image_path in html_image (messju) - fixed errornous creation of '//' in image_path in html_image (messju)
- fix escapement of special chars for key vals in debug - fix escapement of special chars for key vals in debug
console (Monte) console (Monte)

View File

@@ -316,6 +316,9 @@ class Smarty_Compiler extends Smarty {
$template_compiled = substr($template_compiled, 0, -1); $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 // run compiled template through postfilter functions
if (count($this->_plugins['postfilter']) > 0) { if (count($this->_plugins['postfilter']) > 0) {
foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) { foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) {