A8C_Files::filter_filetype_check PHP Method

filter_filetype_check() public method

Leverages Mogile backend, which will return a 406 or other non-200 code if the filetype is unsupported
public filter_filetype_check ( $filetype_data, $file, $filename, $mimes )
    public function filter_filetype_check($filetype_data, $file, $filename, $mimes)
    {
        $filename = $this->_sanitize_filename($filename, '.' . pathinfo($filename, PATHINFO_EXTENSION));
        $check = $this->_check_uniqueness_with_backend($filename);
        // Setting `ext` and `type` to empty will fail the upload because Go doesn't allow unfiltered uploads
        // See `_wp_handle_upload()`
        if (200 != $check['http_code']) {
            $filetype_data['ext'] = '';
            $filetype_data['type'] = '';
            $filetype_data['proper_filename'] = false;
            // Never set this true, which leaves filename changing to dedicated methods in this class
        }
        return $filetype_data;
    }