+++ /dev/null
-<?php\r
-/**\r
- * Smarty plugin\r
- * @package Smarty\r
- * @subpackage plugins\r
- */\r
-\r
-/**\r
- * @access private\r
- */\r
-/**\r
- * determines if a resource is trusted or not\r
- *\r
- * @param string $resource_type\r
- * @param string $resource_name\r
- * @return boolean\r
- */\r
-\r
- // $resource_type, $resource_name\r
-\r
-function smarty_core_is_trusted($params, &$smarty)\r
-{\r
- $_smarty_trusted = false;\r
- if ($params['resource_type'] == 'file') {\r
- if (!empty($smarty->trusted_dir)) {\r
- $_rp = realpath($params['resource_name']);\r
- foreach ((array)$smarty->trusted_dir as $curr_dir) {\r
- if (!empty($curr_dir) && is_readable ($curr_dir)) {\r
- $_cd = realpath($curr_dir);\r
- if (strncmp($_rp, $_cd, strlen($_cd)) == 0\r
- && $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) {\r
- $_smarty_trusted = true;\r
- break;\r
- }\r
- }\r
- }\r
- }\r
-\r
- } else {\r
- // resource is not on local file system\r
- $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],\r
- array($params['resource_name'], $smarty));\r
- }\r
-\r
- return $_smarty_trusted;\r
-}\r
-\r
-/* vim: set expandtab: */\r
-\r
-?>\r