mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-27 02:11:37 +01:00
- fixed typo in compile_continue
- fixed security in {fetch} plugin
- changed back plugin parameters to two. second is template object
with transparent access to Smarty object
- fixed {config_load} scoping form compile time to run time
28 lines
628 B
PHP
28 lines
628 B
PHP
<?php
|
|
/**
|
|
* Smarty plugin to execute PHP code
|
|
*
|
|
* @package Smarty
|
|
* @subpackage PluginsBlock
|
|
* @author Uwe Tews
|
|
*/
|
|
|
|
/**
|
|
* Smarty {php}{/php} block plugin
|
|
*
|
|
* @param string $content contents of the block
|
|
* @param object $smarty Smarty object
|
|
* @param boolean $ &$repeat repeat flag
|
|
* @param object $template template object
|
|
* @return string content re-formatted
|
|
*/
|
|
function smarty_block_php($params, $content, $template, &$repeat)
|
|
{
|
|
if (!$template->allow_php_tag) {
|
|
throw new SmartyException("{php} is deprecated, set allow_php_tag = true to enable");
|
|
}
|
|
eval($content);
|
|
return '';
|
|
}
|
|
|
|
?>
|