X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fsmarty%2Flibs%2Finternals%2Fcore.is_trusted.php;fp=wwwroot%2Fsmarty%2Flibs%2Finternals%2Fcore.is_trusted.php;h=f0bd2fb8c96f945e9e0d9015749e07a6e9bf84b4;hb=e034221efbc7970ec58be22d7517fd3c503dc903;hp=0000000000000000000000000000000000000000;hpb=c6f21b69e8210bdd0e80cf87f1c2f06dfc848a75;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/smarty/libs/internals/core.is_trusted.php b/wwwroot/smarty/libs/internals/core.is_trusted.php new file mode 100644 index 0000000..f0bd2fb --- /dev/null +++ b/wwwroot/smarty/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: */ + +?>