esw_upload_check()
Gives an SVG its type back when fileinfo could not name it.
Function · Easy SVG · Status: Internal · Defined in easy-svg.php
Usage
esw_upload_check( array $checked, string $file, string $filename, array $mimes ): array
Example
$checked = esw_upload_check( $checked, $tmp, 'logo.svg', get_allowed_mime_types() );
Description
Hooked on wp_check_filetype_and_ext while SVG uploads are on. fileinfo often reads an SVG without an XML declaration as text and core drops its type. When the name ends in .svg, no type was found, and the site allows image/svg+xml, this returns ext svg and type image/svg+xml so the upload filter can sanitize the file. Pluggable like esw_add_support().
Parameters
ext, type and proper_filename.
Full path.
File name.
Allowed types.
Return value
The check result.