Skip to content

Commit 0154f17

Browse files
committed
- bugfix removed security hole when using {$smarty.template}
1 parent 5c8541e commit 0154f17

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

change_log.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
===== SVN trunk =====
2+
09/02/2011
3+
- bugfix removed security hole when using {$smarty.template}
4+
25
01/02/2011
36
- removed assert() from config and template parser
47

libs/sysplugins/smarty_internal_compile_private_special_variable.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@ public function compile($args, $compiler, $parameter)
5656
break;
5757

5858
case 'template':
59-
$_template_name = basename($compiler->template->getTemplateFilepath());
60-
return "'$_template_name'";
59+
return 'basename($_smarty_tpl->getTemplateFilepath())';
6160

6261
case 'current_dir':
63-
$_template_dir_name = dirname($compiler->template->getTemplateFilepath());
64-
return "'$_template_dir_name'";
62+
return 'dirname($_smarty_tpl->getTemplateFilepath())';
6563

6664
case 'version':
6765
$_version = Smarty::SMARTY_VERSION;

0 commit comments

Comments
 (0)