• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • Examples
  • File List

E:/E/GEAMP/www/openbiz/openbiz/others/Smarty/libs/internals/core.is_trusted.php

00001 <?php
00016  // $resource_type, $resource_name
00017 
00018 function smarty_core_is_trusted($params, &$smarty)
00019 {
00020     $_smarty_trusted = false;
00021     if ($params['resource_type'] == 'file') {
00022         if (!empty($smarty->trusted_dir)) {
00023             $_rp = realpath($params['resource_name']);
00024             foreach ((array)$smarty->trusted_dir as $curr_dir) {
00025                 if (!empty($curr_dir) && is_readable ($curr_dir)) {
00026                     $_cd = realpath($curr_dir);
00027                     if (strncmp($_rp, $_cd, strlen($_cd)) == 0
00028                         && $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) {
00029                         $_smarty_trusted = true;
00030                         break;
00031                     }
00032                 }
00033             }
00034         }
00035 
00036     } else {
00037         // resource is not on local file system
00038         $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3],
00039                                                 array($params['resource_name'], $smarty));
00040     }
00041 
00042     return $_smarty_trusted;
00043 }
00044 
00045 /* vim: set expandtab: */
00046 
00047 ?>

Generated on Thu Apr 19 2012 17:01:16 for openbiz by  doxygen 1.7.2