- bugfix for {php} tag (trow an exception if allow_php_tag = false)

This commit is contained in:
Uwe.Tews
2010-01-01 20:19:26 +00:00
parent 8c93e0765a
commit b5ff9e450f
2 changed files with 4 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
01/01/2009
- bugfix for obtaining plugins which must be included (related to change of 12/30/2009)
- bugfix for {php} tag (trow an exception if allow_php_tag = false)
12/31/2009
- optimization of generated code for doublequoted strings containing variables

View File

@@ -18,22 +18,10 @@
*/
function smarty_block_php($params, $content, $smarty, &$repeat, $template)
{
// get security settings
if ($template->security && isset($smarty->security_handler)) {
$sec_obj = $smarty->security_policy;
} else {
$sec_obj = $smarty;
if (!$smarty->allow_php_tag) {
throw new Exception("{php} is deprecated, set allow_php_tag = true to enable");
}
if (is_null($content)) {
if (!$smarty->allow_php_tag) {
trigger_error("{php} is deprecated, set allow_php_tag = true to enable", E_USER_WARNING);
}
return;
}
eval($content);
return '';
}
}
?>