diff options
| author | Uwe.Tews@googlemail.com <Uwe.Tews@googlemail.com> | 2013-10-20 15:27:35 +0000 |
|---|---|---|
| committer | Uwe.Tews@googlemail.com <Uwe.Tews@googlemail.com> | 2013-10-20 15:27:35 +0000 |
| commit | 8342cf45f31a1bbaf8995d90ad7a4744431ebfe6 (patch) | |
| tree | 7fbc540a5a6d1ae074a998c6314351a5eced6ff0 | |
| parent | fccd80818b71593517507bf1b030d076a1942f4c (diff) | |
| download | smarty-8342cf45f31a1bbaf8995d90ad7a4744431ebfe6.tar.gz smarty-8342cf45f31a1bbaf8995d90ad7a4744431ebfe6.tar.bz2 smarty-8342cf45f31a1bbaf8995d90ad7a4744431ebfe6.zip | |
- bugfix a variable file name at {extends} tag did fail (forum topic 24618)
| -rw-r--r-- | change_log.txt | 3 | ||||
| -rw-r--r-- | libs/sysplugins/smarty_internal_compile_extends.php | 6 |
2 files changed, 7 insertions, 2 deletions
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])) { |
