示例#1
0
 /**
  * Checks if path is restricted by open_basedir
  *
  * @param string  $path
  * @return boolean
  */
 public static function check_open_basedir($path)
 {
     $path = Util_Environment::realpath($path);
     $open_basedirs = Util_File::get_open_basedirs();
     if (!count($open_basedirs)) {
         return true;
     }
     foreach ($open_basedirs as $open_basedir) {
         if (strstr($path, $open_basedir) !== false) {
             return true;
         }
     }
     return false;
 }