5 // Function that check if given filename is "secure" (for uploading)
6 // Dont use for reading files, directory traversal is not checked
8 public static function upload_filename_secure($name){
9 $suffix = array_pop(explode('.', basename($name)));
11 // This is unfornately blacklist
12 // TODO extend for all possible server configuations
14 $preg_disallowed = '/([a-z]*)(php|htm|inc|js|vbs|cgi|asp|jsp|htaccess|htpasswd|asmx)([a-z]*)$/i';
15 if (preg_match($preg_disallowed, $suffix) > 0) {