From c0130d5d3483f676e2df305cbf158562accfde17 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Mon, 22 Nov 2010 22:03:47 +0000 Subject: [PATCH] - added error message for illegal variable file attributes at {extends...} tags --- change_log.txt | 1 + libs/sysplugins/smarty_internal_compile_extends.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/change_log.txt b/change_log.txt index 0f5f3794..6f6bf2ae 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,5 +1,6 @@ 22/11/2010 - bugfix on template inheritance when an {extends} tag was inserted by a prefilter +- added error message for illegal variable file attributes at {extends...} tags ===== Smarty 3.0.5 ===== diff --git a/libs/sysplugins/smarty_internal_compile_extends.php b/libs/sysplugins/smarty_internal_compile_extends.php index 3d3ac797..b62b531d 100644 --- a/libs/sysplugins/smarty_internal_compile_extends.php +++ b/libs/sysplugins/smarty_internal_compile_extends.php @@ -40,6 +40,9 @@ class Smarty_Internal_Compile_Extends extends Smarty_Internal_CompileBase { $_smarty_tpl = $compiler->template; $include_file = null; + if (strpos($_attr['file'],'$_tmp') !== false) { + $this->compiler->trigger_template_error('illegal value for file attribute', $this->compiler->lex->taglineno); + } eval('$include_file = ' . $_attr['file'] . ';'); // create template object $_template = new $compiler->smarty->template_class($include_file, $this->smarty, $compiler->template);