diff --git a/change_log.txt b/change_log.txt index 04e0dd6c..7e93d057 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== trunk ===== + 20.10.2013 + - bugfix a variable file name at {extends} tag did fail (forum topic 24618) + 14.10.2013 - bugfix yesterdays fix could result in an undefined variable diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index c60a9dee..aca36c12 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -51,9 +51,11 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno); } - $name = trim($_attr['file'],"\"'"); + $name = $_attr['file']; + $_smarty_tpl = $compiler->template; + eval("\$tpl_name = $name;"); // create template object - $_template = new $compiler->smarty->template_class($name, $compiler->smarty, $compiler->template); + $_template = new $compiler->smarty->template_class($tpl_name, $compiler->smarty, $compiler->template); // check for recursion $uid = $_template->source->uid; if (isset($compiler->extends_uid[$uid])) {