diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 7981315b..c38c21b1 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -854,6 +854,24 @@ abstract class Smarty_Internal_TemplateCompilerBase return false; } + /** + * Append code segments and remove unneeded ?> \s*$/', $left) && preg_match('/^\s*<\?php\s+/', $right)) { + $left = preg_replace('/\s*\?>\s*$/', "\n", $left); + $left .= preg_replace('/^\s*<\?php\s+/', '', $right); + } else { + $left .= $right; + } + return $left; + } + /** * Inject inline code for nocache template sections * This method gets the content of each template element from the parser.