示例#1
0
 static function getAttachFormatRegex()
 {
     if (substr(FSS_Input::GetCmd('view'), 0, 5) == "admin") {
         $formats = trim(FSS_Settings::get('support_attach_types_admins'));
     } else {
         $formats = trim(FSS_Settings::get('support_attach_types'));
     }
     if (substr($formats, 0, 1) == "/") {
         return $formats;
     }
     $parsed = array();
     if ($formats != "") {
         $formats = explode(",", $formats);
         foreach ($formats as $fm) {
             $fm = trim($fm);
             if (!$fm) {
                 continue;
             }
             $parsed[] = $fm;
         }
     }
     if (count($parsed) > 0) {
         return "/.(" . implode("|", $parsed) . ")\$/i";
     }
     return "null";
 }