21 $params[
'resource_base_path'] = $smarty->trusted_dir;
22 $smarty->_parse_resource_name($params, $smarty);
28 if ($params[
'resource_type'] ==
'file') {
30 if(file_exists($params[
'resource_name']) && is_readable($params[
'resource_name'])) {
34 $_params = array(
'file_path' => $params[
'resource_name']);
35 require_once(SMARTY_CORE_DIR .
'core.get_include_path.php');
37 $_include_path = $_params[
'new_file_path'];
41 }
else if ($params[
'resource_type'] !=
'file') {
42 $_template_source = null;
43 $_readable = is_callable($smarty->_plugins[
'resource'][$params[
'resource_type']][0][0])
44 && call_user_func_array($smarty->_plugins[
'resource'][$params[
'resource_type']][0][0],
45 array($params[
'resource_name'], &$_template_source, &$smarty));
51 if (method_exists($smarty,
'_syntax_error')) {
52 $_error_funcc =
'_syntax_error';
54 $_error_funcc =
'trigger_error';
58 if ($smarty->security) {
59 require_once(SMARTY_CORE_DIR .
'core.is_trusted.php');
61 $smarty->$_error_funcc(
'(secure mode) ' . $params[
'resource_type'] .
':' . $params[
'resource_name'] .
' is not trusted');
66 $smarty->$_error_funcc($params[
'resource_type'] .
':' . $params[
'resource_name'] .
' is not readable');
70 if ($params[
'resource_type'] ==
'file') {
71 $params[
'php_resource'] = $params[
'resource_name'];
73 $params[
'php_resource'] = $_template_source;