mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- improvement remove last linebreak from {function} definition
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
- reverted location of loadPlugin() to Smarty class
|
- reverted location of loadPlugin() to Smarty class
|
||||||
- fixed comments in plugins
|
- fixed comments in plugins
|
||||||
- fixed internal_config (removed unwanted code line)
|
- fixed internal_config (removed unwanted code line)
|
||||||
|
- improvement remove last linebreak from {function} definition
|
||||||
|
|
||||||
===== Smarty 3.0.2 =====
|
===== Smarty 3.0.2 =====
|
||||||
|
|
||||||
|
@@ -104,6 +104,11 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
|
|||||||
}
|
}
|
||||||
$plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
|
$plugins_string .= "?>/*/%%SmartyNocache:{$compiler->template->properties['nocache_hash']}%%*/';?>\n";
|
||||||
}
|
}
|
||||||
|
// remove last line break from function definition
|
||||||
|
$last = count($compiler->parser->current_buffer->subtrees) - 1;
|
||||||
|
if ($compiler->parser->current_buffer->subtrees[$last] instanceof _smarty_linebreak) {
|
||||||
|
unset($compiler->parser->current_buffer->subtrees[$last]);
|
||||||
|
}
|
||||||
// if caching save template function for possible nocache call
|
// if caching save template function for possible nocache call
|
||||||
if ($compiler->template->caching) {
|
if ($compiler->template->caching) {
|
||||||
$compiler->template->properties['function'][$_name]['compiled'] .= $plugins_string
|
$compiler->template->properties['function'][$_name]['compiled'] .= $plugins_string
|
||||||
|
Reference in New Issue
Block a user