From 0154f17de2b2dd16ff9c016923015ac19af9c0cb Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Wed, 9 Feb 2011 17:50:05 +0000 Subject: [PATCH] - bugfix removed security hole when using {$smarty.template} --- change_log.txt | 3 +++ .../smarty_internal_compile_private_special_variable.php | 6 ++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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;