X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=smarty%2FSmarty-2.6.10%2Flibs%2Finternals%2Fcore.is_trusted.php;fp=smarty%2FSmarty-2.6.10%2Flibs%2Finternals%2Fcore.is_trusted.php;h=f0bd2fb8c96f945e9e0d9015749e07a6e9bf84b4;hb=b42b2bf946332ad8544d53f610be9cb05e80bf56;hp=0000000000000000000000000000000000000000;hpb=e586807dafc64c3fe152ab518599e6cf3f0f84e1;p=mirrors%2FKyberia-bloodline.git diff --git a/smarty/Smarty-2.6.10/libs/internals/core.is_trusted.php b/smarty/Smarty-2.6.10/libs/internals/core.is_trusted.php new file mode 100644 index 0000000..f0bd2fb --- /dev/null +++ b/smarty/Smarty-2.6.10/libs/internals/core.is_trusted.php @@ -0,0 +1,47 @@ +trusted_dir)) { + $_rp = realpath($params['resource_name']); + foreach ((array)$smarty->trusted_dir as $curr_dir) { + if (!empty($curr_dir) && is_readable ($curr_dir)) { + $_cd = realpath($curr_dir); + if (strncmp($_rp, $_cd, strlen($_cd)) == 0 + && $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { + $_smarty_trusted = true; + break; + } + } + } + } + + } else { + // resource is not on local file system + $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], + array($params['resource_name'], $smarty)); + } + + return $_smarty_trusted; +} + +/* vim: set expandtab: */ + +?>