diff --git a/change_log.txt b/change_log.txt index 7fa4ac8b..426d5e0a 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,7 @@ 01/14/2010 - bugfix on backslash within single quoted strings - bugfix allow absolute filepath for config files +- bugfix on special Smarty variable $smarty.cookies 01/13/2010 - bugfix on {if} tags diff --git a/libs/sysplugins/smarty_internal_compile_private_special_variable.php b/libs/sysplugins/smarty_internal_compile_private_special_variable.php index 9e261625..1f473bc5 100644 --- a/libs/sysplugins/smarty_internal_compile_private_special_variable.php +++ b/libs/sysplugins/smarty_internal_compile_private_special_variable.php @@ -33,10 +33,16 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C return "\$_smarty_tpl->smarty->_smarty_vars$args"; case 'now': return 'time()'; + case 'cookies': + if ($compiler->smarty->security && !$compiler->smarty->security_policy->allow_super_globals) { + $compiler->trigger_template_error("(secure mode) super globals not permitted"); + break; + } + $compiled_ref = '$_COOKIE'; + break; case 'get': case 'post': - case 'cookies': case 'env': case 'server': case 'session': @@ -45,7 +51,7 @@ class Smarty_Internal_Compile_Private_Special_Variable extends Smarty_Internal_C $compiler->trigger_template_error("(secure mode) super globals not permitted"); break; } - $compiled_ref = "\$_".strtoupper($variable); + $compiled_ref = '$_'.strtoupper($variable); break; case 'template':