Хранилища Subversion ant

Редакция

Содержимое файла | Последнее изменение | Открыть журнал | RSS

Редакция Автор № строки Строка
304 alex-w 1
<?php
2
/**
3
* Smarty plugin to execute PHP code
4
*
5
* @package Smarty
6
* @subpackage PluginsBlock
7
* @author Uwe Tews
8
*/
9
 
10
/**
11
* Smarty {php}{/php} block plugin
12
*
13
* @param string $content contents of the block
14
* @param object $smarty Smarty object
15
* @param boolean $ &$repeat repeat flag
16
* @param object $template template object
17
* @return string content re-formatted
18
*/
19
function smarty_block_php($params, $content, $smarty, &$repeat, $template)
20
{
21
    // get security settings
22
    if ($template->security && isset($smarty->security_handler)) {
23
        $sec_obj = $smarty->security_policy;
24
    } else {
25
        $sec_obj = $smarty;
26
    }
27
    if (is_null($content)) {
28
        if (!$smarty->allow_php_tag) {
29
            trigger_error("{php} is deprecated, set allow_php_tag = true to enable", E_USER_WARNING);
30
        }
31
        return;
32
    }
33
 
34
    eval($content);
35
 
36
    return '';
37
}
38
 
39
?>