示例#1
0
 private static function isInList($path, $allowed = array())
 {
     if (is_string($allowed)) {
         $allowed = array($allowed);
     }
     if (count($allowed) > 0) {
         foreach ($allowed as $ext) {
             //convert to reqex if not
             if ($ext === '*') {
                 $ext = '.*?';
             }
             if (!XApp_Utils_Strings::isRegEx($ext)) {
                 $ext = '/\\.' . $ext . '$/U';
             }
             if (preg_match($ext, $path)) {
                 return true;
             }
         }
     }
     return false;
 }