diff --git a/change_log.txt b/change_log.txt index 2d97d2f4..3e960845 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== SVN trunk ===== +09/02/2011 +- bugfix removed security hole when using {$smarty.template} + 01/02/2011 - removed assert() from config and template parser diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 44910c34..5d6ae801 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -56,12 +56,10 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C break; case 'template': - $_template_name = basename($compiler->template->getTemplateFilepath()); - return "'$_template_name'"; + return 'basename($_smarty_tpl->getTemplateFilepath())'; case 'current_dir': - $_template_dir_name = dirname($compiler->template->getTemplateFilepath()); - return "'$_template_dir_name'"; + return 'dirname($_smarty_tpl->getTemplateFilepath())'; case 'version': $_version = Smarty::SMARTY_VERSION;