public function get_unknown_file_types($types) {
        $unknown = [];

        foreach ($this->normalize_file_types($types) as $type) {
            if ($type === '*') {
                // Any file is considered as a known type.
                continue;
            } else if ($type === '.xxx') {
                $unknown[$type] = true;
            } else if ($this->is_filetype_group($type)) {
                // The type is a group that exists.
                continue;
            } else if ($this->looks_like_mimetype($type)) {
                // If there's no extension associated with that mimetype, we consider it unknown.
                if (empty(file_get_typegroup('extension', [$type]))) {
                    $unknown[$type] = true;
                }
            } else {
                $coretypes = core_filetypes::get_types();
                $typecleaned = str_replace(".", "", $type);
                if (empty($coretypes[$typecleaned])) {
                    // If there's no extension, it doesn't exist.
                    $unknown[$type] = true;
                }
            }
        }

        return array_keys($unknown);
    }
public function get_unknown_file_types($types) {
        $unknown = [];

        foreach ($this->normalize_file_types($types) as $type) {
            if ($type === '*') {
                // Any file is considered as a known type.
                continue;
            } else if ($type === '.xxx') {
                $unknown[$type] = true;
            } else if ($this->is_filetype_group($type)) {
                // The type is a group that exists.
                continue;
            } else if ($this->looks_like_mimetype($type)) {
                // If there's no extension associated with that mimetype, we consider it unknown.
                if (empty(file_get_typegroup('extension', [$type]))) {
                    $unknown[$type] = true;
                }
            } else {
                $coretypes = core_filetypes::get_types();
                $typecleaned = str_replace(".", "", $type);
                if (empty($coretypes[$typecleaned])) {
                    // If there's no extension, it doesn't exist.
                    $unknown[$type] = true;
                }
            }
        }

        return array_keys($unknown);
    }
public function get_unknown_file_types ( $ types ) { $ unknown = [ ] ; foreach ( $ this -> normalize_file_types ( $ types ) as $ type ) { if ( $ type === '*' ) { // Any file is considered as a known type. continue ; } else if ( $ type === '.xxx' ) { $ unknown [ $ type ] = true ; } else if ( $ this -> is_filetype_group ( $ type ) ) { // The type is a group that exists. continue ; } else if ( $ this -> looks_like_mimetype ( $ type ) ) { // If there's no extension associated with that mimetype, we consider it unknown. if ( empty ( file_get_typegroup ( 'extension' , [ $ type ] ) ) ) { $ unknown [ $ type ] = true ; } } else { $ coretypes = core_filetypes :: get_types ( ) ; $ typecleaned = str_replace ( "." , "" , $ type ) ; if ( empty ( $ coretypes [ $ typecleaned ] ) ) { // If there's no extension, it doesn't exist. $ unknown [ $ type ] = true ; } } } return array_keys ( $ unknown ) ; }
Returns file types from the list that are not recognized

@param string|array $types list of user-defined file types
@return array A list of unknown file types.
Returns file types from the list that are not recognized