Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-inclu...
File: functions.php
}
[3000] Fix | Delete
[3001] Fix | Delete
/**
[3002] Fix | Delete
* Returns first matched extension for the mime-type,
[3003] Fix | Delete
* as mapped from wp_get_mime_types().
[3004] Fix | Delete
*
[3005] Fix | Delete
* @since 5.8.1
[3006] Fix | Delete
*
[3007] Fix | Delete
* @param string $mime_type
[3008] Fix | Delete
*
[3009] Fix | Delete
* @return string|false
[3010] Fix | Delete
*/
[3011] Fix | Delete
function wp_get_default_extension_for_mime_type( $mime_type ) {
[3012] Fix | Delete
$extensions = explode( '|', array_search( $mime_type, wp_get_mime_types(), true ) );
[3013] Fix | Delete
[3014] Fix | Delete
if ( empty( $extensions[0] ) ) {
[3015] Fix | Delete
return false;
[3016] Fix | Delete
}
[3017] Fix | Delete
[3018] Fix | Delete
return $extensions[0];
[3019] Fix | Delete
}
[3020] Fix | Delete
[3021] Fix | Delete
/**
[3022] Fix | Delete
* Retrieves the file type from the file name.
[3023] Fix | Delete
*
[3024] Fix | Delete
* You can optionally define the mime array, if needed.
[3025] Fix | Delete
*
[3026] Fix | Delete
* @since 2.0.4
[3027] Fix | Delete
*
[3028] Fix | Delete
* @param string $filename File name or path.
[3029] Fix | Delete
* @param string[]|null $mimes Optional. Array of allowed mime types keyed by their file extension regex.
[3030] Fix | Delete
* Defaults to the result of get_allowed_mime_types().
[3031] Fix | Delete
* @return array {
[3032] Fix | Delete
* Values for the extension and mime type.
[3033] Fix | Delete
*
[3034] Fix | Delete
* @type string|false $ext File extension, or false if the file doesn't match a mime type.
[3035] Fix | Delete
* @type string|false $type File mime type, or false if the file doesn't match a mime type.
[3036] Fix | Delete
* }
[3037] Fix | Delete
*/
[3038] Fix | Delete
function wp_check_filetype( $filename, $mimes = null ) {
[3039] Fix | Delete
if ( empty( $mimes ) ) {
[3040] Fix | Delete
$mimes = get_allowed_mime_types();
[3041] Fix | Delete
}
[3042] Fix | Delete
$type = false;
[3043] Fix | Delete
$ext = false;
[3044] Fix | Delete
[3045] Fix | Delete
foreach ( $mimes as $ext_preg => $mime_match ) {
[3046] Fix | Delete
$ext_preg = '!\.(' . $ext_preg . ')$!i';
[3047] Fix | Delete
if ( preg_match( $ext_preg, $filename, $ext_matches ) ) {
[3048] Fix | Delete
$type = $mime_match;
[3049] Fix | Delete
$ext = $ext_matches[1];
[3050] Fix | Delete
break;
[3051] Fix | Delete
}
[3052] Fix | Delete
}
[3053] Fix | Delete
[3054] Fix | Delete
return compact( 'ext', 'type' );
[3055] Fix | Delete
}
[3056] Fix | Delete
[3057] Fix | Delete
/**
[3058] Fix | Delete
* Attempts to determine the real file type of a file.
[3059] Fix | Delete
*
[3060] Fix | Delete
* If unable to, the file name extension will be used to determine type.
[3061] Fix | Delete
*
[3062] Fix | Delete
* If it's determined that the extension does not match the file's real type,
[3063] Fix | Delete
* then the "proper_filename" value will be set with a proper filename and extension.
[3064] Fix | Delete
*
[3065] Fix | Delete
* Currently this function only supports renaming images validated via wp_get_image_mime().
[3066] Fix | Delete
*
[3067] Fix | Delete
* @since 3.0.0
[3068] Fix | Delete
*
[3069] Fix | Delete
* @param string $file Full path to the file.
[3070] Fix | Delete
* @param string $filename The name of the file (may differ from $file due to $file being
[3071] Fix | Delete
* in a tmp directory).
[3072] Fix | Delete
* @param string[]|null $mimes Optional. Array of allowed mime types keyed by their file extension regex.
[3073] Fix | Delete
* Defaults to the result of get_allowed_mime_types().
[3074] Fix | Delete
* @return array {
[3075] Fix | Delete
* Values for the extension, mime type, and corrected filename.
[3076] Fix | Delete
*
[3077] Fix | Delete
* @type string|false $ext File extension, or false if the file doesn't match a mime type.
[3078] Fix | Delete
* @type string|false $type File mime type, or false if the file doesn't match a mime type.
[3079] Fix | Delete
* @type string|false $proper_filename File name with its correct extension, or false if it cannot be determined.
[3080] Fix | Delete
* }
[3081] Fix | Delete
*/
[3082] Fix | Delete
function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) {
[3083] Fix | Delete
$proper_filename = false;
[3084] Fix | Delete
[3085] Fix | Delete
// Do basic extension validation and MIME mapping.
[3086] Fix | Delete
$wp_filetype = wp_check_filetype( $filename, $mimes );
[3087] Fix | Delete
$ext = $wp_filetype['ext'];
[3088] Fix | Delete
$type = $wp_filetype['type'];
[3089] Fix | Delete
[3090] Fix | Delete
// We can't do any further validation without a file to work with.
[3091] Fix | Delete
if ( ! file_exists( $file ) ) {
[3092] Fix | Delete
return compact( 'ext', 'type', 'proper_filename' );
[3093] Fix | Delete
}
[3094] Fix | Delete
[3095] Fix | Delete
$real_mime = false;
[3096] Fix | Delete
[3097] Fix | Delete
// Validate image types.
[3098] Fix | Delete
if ( $type && str_starts_with( $type, 'image/' ) ) {
[3099] Fix | Delete
[3100] Fix | Delete
// Attempt to figure out what type of image it actually is.
[3101] Fix | Delete
$real_mime = wp_get_image_mime( $file );
[3102] Fix | Delete
[3103] Fix | Delete
if ( $real_mime && $real_mime !== $type ) {
[3104] Fix | Delete
/**
[3105] Fix | Delete
* Filters the list mapping image mime types to their respective extensions.
[3106] Fix | Delete
*
[3107] Fix | Delete
* @since 3.0.0
[3108] Fix | Delete
*
[3109] Fix | Delete
* @param array $mime_to_ext Array of image mime types and their matching extensions.
[3110] Fix | Delete
*/
[3111] Fix | Delete
$mime_to_ext = apply_filters(
[3112] Fix | Delete
'getimagesize_mimes_to_exts',
[3113] Fix | Delete
array(
[3114] Fix | Delete
'image/jpeg' => 'jpg',
[3115] Fix | Delete
'image/png' => 'png',
[3116] Fix | Delete
'image/gif' => 'gif',
[3117] Fix | Delete
'image/bmp' => 'bmp',
[3118] Fix | Delete
'image/tiff' => 'tif',
[3119] Fix | Delete
'image/webp' => 'webp',
[3120] Fix | Delete
'image/avif' => 'avif',
[3121] Fix | Delete
)
[3122] Fix | Delete
);
[3123] Fix | Delete
[3124] Fix | Delete
// Replace whatever is after the last period in the filename with the correct extension.
[3125] Fix | Delete
if ( ! empty( $mime_to_ext[ $real_mime ] ) ) {
[3126] Fix | Delete
$filename_parts = explode( '.', $filename );
[3127] Fix | Delete
array_pop( $filename_parts );
[3128] Fix | Delete
$filename_parts[] = $mime_to_ext[ $real_mime ];
[3129] Fix | Delete
$new_filename = implode( '.', $filename_parts );
[3130] Fix | Delete
[3131] Fix | Delete
if ( $new_filename !== $filename ) {
[3132] Fix | Delete
$proper_filename = $new_filename; // Mark that it changed.
[3133] Fix | Delete
}
[3134] Fix | Delete
[3135] Fix | Delete
// Redefine the extension / MIME.
[3136] Fix | Delete
$wp_filetype = wp_check_filetype( $new_filename, $mimes );
[3137] Fix | Delete
$ext = $wp_filetype['ext'];
[3138] Fix | Delete
$type = $wp_filetype['type'];
[3139] Fix | Delete
} else {
[3140] Fix | Delete
// Reset $real_mime and try validating again.
[3141] Fix | Delete
$real_mime = false;
[3142] Fix | Delete
}
[3143] Fix | Delete
}
[3144] Fix | Delete
}
[3145] Fix | Delete
[3146] Fix | Delete
// Validate files that didn't get validated during previous checks.
[3147] Fix | Delete
if ( $type && ! $real_mime && extension_loaded( 'fileinfo' ) ) {
[3148] Fix | Delete
$finfo = finfo_open( FILEINFO_MIME_TYPE );
[3149] Fix | Delete
$real_mime = finfo_file( $finfo, $file );
[3150] Fix | Delete
finfo_close( $finfo );
[3151] Fix | Delete
[3152] Fix | Delete
$google_docs_types = array(
[3153] Fix | Delete
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
[3154] Fix | Delete
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
[3155] Fix | Delete
);
[3156] Fix | Delete
[3157] Fix | Delete
foreach ( $google_docs_types as $google_docs_type ) {
[3158] Fix | Delete
/*
[3159] Fix | Delete
* finfo_file() can return duplicate mime type for Google docs,
[3160] Fix | Delete
* this conditional reduces it to a single instance.
[3161] Fix | Delete
*
[3162] Fix | Delete
* @see https://bugs.php.net/bug.php?id=77784
[3163] Fix | Delete
* @see https://core.trac.wordpress.org/ticket/57898
[3164] Fix | Delete
*/
[3165] Fix | Delete
if ( 2 === substr_count( $real_mime, $google_docs_type ) ) {
[3166] Fix | Delete
$real_mime = $google_docs_type;
[3167] Fix | Delete
}
[3168] Fix | Delete
}
[3169] Fix | Delete
[3170] Fix | Delete
// fileinfo often misidentifies obscure files as one of these types.
[3171] Fix | Delete
$nonspecific_types = array(
[3172] Fix | Delete
'application/octet-stream',
[3173] Fix | Delete
'application/encrypted',
[3174] Fix | Delete
'application/CDFV2-encrypted',
[3175] Fix | Delete
'application/zip',
[3176] Fix | Delete
);
[3177] Fix | Delete
[3178] Fix | Delete
/*
[3179] Fix | Delete
* If $real_mime doesn't match the content type we're expecting from the file's extension,
[3180] Fix | Delete
* we need to do some additional vetting. Media types and those listed in $nonspecific_types are
[3181] Fix | Delete
* allowed some leeway, but anything else must exactly match the real content type.
[3182] Fix | Delete
*/
[3183] Fix | Delete
if ( in_array( $real_mime, $nonspecific_types, true ) ) {
[3184] Fix | Delete
// File is a non-specific binary type. That's ok if it's a type that generally tends to be binary.
[3185] Fix | Delete
if ( ! in_array( substr( $type, 0, strcspn( $type, '/' ) ), array( 'application', 'video', 'audio' ), true ) ) {
[3186] Fix | Delete
$type = false;
[3187] Fix | Delete
$ext = false;
[3188] Fix | Delete
}
[3189] Fix | Delete
} elseif ( str_starts_with( $real_mime, 'video/' ) || str_starts_with( $real_mime, 'audio/' ) ) {
[3190] Fix | Delete
/*
[3191] Fix | Delete
* For these types, only the major type must match the real value.
[3192] Fix | Delete
* This means that common mismatches are forgiven: application/vnd.apple.numbers is often misidentified as application/zip,
[3193] Fix | Delete
* and some media files are commonly named with the wrong extension (.mov instead of .mp4)
[3194] Fix | Delete
*/
[3195] Fix | Delete
if ( substr( $real_mime, 0, strcspn( $real_mime, '/' ) ) !== substr( $type, 0, strcspn( $type, '/' ) ) ) {
[3196] Fix | Delete
$type = false;
[3197] Fix | Delete
$ext = false;
[3198] Fix | Delete
}
[3199] Fix | Delete
} elseif ( 'text/plain' === $real_mime ) {
[3200] Fix | Delete
// A few common file types are occasionally detected as text/plain; allow those.
[3201] Fix | Delete
if ( ! in_array(
[3202] Fix | Delete
$type,
[3203] Fix | Delete
array(
[3204] Fix | Delete
'text/plain',
[3205] Fix | Delete
'text/csv',
[3206] Fix | Delete
'application/csv',
[3207] Fix | Delete
'text/richtext',
[3208] Fix | Delete
'text/tsv',
[3209] Fix | Delete
'text/vtt',
[3210] Fix | Delete
),
[3211] Fix | Delete
true
[3212] Fix | Delete
)
[3213] Fix | Delete
) {
[3214] Fix | Delete
$type = false;
[3215] Fix | Delete
$ext = false;
[3216] Fix | Delete
}
[3217] Fix | Delete
} elseif ( 'application/csv' === $real_mime ) {
[3218] Fix | Delete
// Special casing for CSV files.
[3219] Fix | Delete
if ( ! in_array(
[3220] Fix | Delete
$type,
[3221] Fix | Delete
array(
[3222] Fix | Delete
'text/csv',
[3223] Fix | Delete
'text/plain',
[3224] Fix | Delete
'application/csv',
[3225] Fix | Delete
),
[3226] Fix | Delete
true
[3227] Fix | Delete
)
[3228] Fix | Delete
) {
[3229] Fix | Delete
$type = false;
[3230] Fix | Delete
$ext = false;
[3231] Fix | Delete
}
[3232] Fix | Delete
} elseif ( 'text/rtf' === $real_mime ) {
[3233] Fix | Delete
// Special casing for RTF files.
[3234] Fix | Delete
if ( ! in_array(
[3235] Fix | Delete
$type,
[3236] Fix | Delete
array(
[3237] Fix | Delete
'text/rtf',
[3238] Fix | Delete
'text/plain',
[3239] Fix | Delete
'application/rtf',
[3240] Fix | Delete
),
[3241] Fix | Delete
true
[3242] Fix | Delete
)
[3243] Fix | Delete
) {
[3244] Fix | Delete
$type = false;
[3245] Fix | Delete
$ext = false;
[3246] Fix | Delete
}
[3247] Fix | Delete
} else {
[3248] Fix | Delete
if ( $type !== $real_mime ) {
[3249] Fix | Delete
/*
[3250] Fix | Delete
* Everything else including image/* and application/*:
[3251] Fix | Delete
* If the real content type doesn't match the file extension, assume it's dangerous.
[3252] Fix | Delete
*/
[3253] Fix | Delete
$type = false;
[3254] Fix | Delete
$ext = false;
[3255] Fix | Delete
}
[3256] Fix | Delete
}
[3257] Fix | Delete
}
[3258] Fix | Delete
[3259] Fix | Delete
// The mime type must be allowed.
[3260] Fix | Delete
if ( $type ) {
[3261] Fix | Delete
$allowed = get_allowed_mime_types();
[3262] Fix | Delete
[3263] Fix | Delete
if ( ! in_array( $type, $allowed, true ) ) {
[3264] Fix | Delete
$type = false;
[3265] Fix | Delete
$ext = false;
[3266] Fix | Delete
}
[3267] Fix | Delete
}
[3268] Fix | Delete
[3269] Fix | Delete
/**
[3270] Fix | Delete
* Filters the "real" file type of the given file.
[3271] Fix | Delete
*
[3272] Fix | Delete
* @since 3.0.0
[3273] Fix | Delete
* @since 5.1.0 The $real_mime parameter was added.
[3274] Fix | Delete
*
[3275] Fix | Delete
* @param array $wp_check_filetype_and_ext {
[3276] Fix | Delete
* Values for the extension, mime type, and corrected filename.
[3277] Fix | Delete
*
[3278] Fix | Delete
* @type string|false $ext File extension, or false if the file doesn't match a mime type.
[3279] Fix | Delete
* @type string|false $type File mime type, or false if the file doesn't match a mime type.
[3280] Fix | Delete
* @type string|false $proper_filename File name with its correct extension, or false if it cannot be determined.
[3281] Fix | Delete
* }
[3282] Fix | Delete
* @param string $file Full path to the file.
[3283] Fix | Delete
* @param string $filename The name of the file (may differ from $file due to
[3284] Fix | Delete
* $file being in a tmp directory).
[3285] Fix | Delete
* @param string[]|null $mimes Array of mime types keyed by their file extension regex, or null if
[3286] Fix | Delete
* none were provided.
[3287] Fix | Delete
* @param string|false $real_mime The actual mime type or false if the type cannot be determined.
[3288] Fix | Delete
*/
[3289] Fix | Delete
return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes, $real_mime );
[3290] Fix | Delete
}
[3291] Fix | Delete
[3292] Fix | Delete
/**
[3293] Fix | Delete
* Returns the real mime type of an image file.
[3294] Fix | Delete
*
[3295] Fix | Delete
* This depends on exif_imagetype() or getimagesize() to determine real mime types.
[3296] Fix | Delete
*
[3297] Fix | Delete
* @since 4.7.1
[3298] Fix | Delete
* @since 5.8.0 Added support for WebP images.
[3299] Fix | Delete
* @since 6.5.0 Added support for AVIF images.
[3300] Fix | Delete
*
[3301] Fix | Delete
* @param string $file Full path to the file.
[3302] Fix | Delete
* @return string|false The actual mime type or false if the type cannot be determined.
[3303] Fix | Delete
*/
[3304] Fix | Delete
function wp_get_image_mime( $file ) {
[3305] Fix | Delete
/*
[3306] Fix | Delete
* Use exif_imagetype() to check the mimetype if available or fall back to
[3307] Fix | Delete
* getimagesize() if exif isn't available. If either function throws an Exception
[3308] Fix | Delete
* we assume the file could not be validated.
[3309] Fix | Delete
*/
[3310] Fix | Delete
try {
[3311] Fix | Delete
if ( is_callable( 'exif_imagetype' ) ) {
[3312] Fix | Delete
$imagetype = exif_imagetype( $file );
[3313] Fix | Delete
$mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false;
[3314] Fix | Delete
} elseif ( function_exists( 'getimagesize' ) ) {
[3315] Fix | Delete
// Don't silence errors when in debug mode, unless running unit tests.
[3316] Fix | Delete
if ( defined( 'WP_DEBUG' ) && WP_DEBUG
[3317] Fix | Delete
&& ! defined( 'WP_RUN_CORE_TESTS' )
[3318] Fix | Delete
) {
[3319] Fix | Delete
// Not using wp_getimagesize() here to avoid an infinite loop.
[3320] Fix | Delete
$imagesize = getimagesize( $file );
[3321] Fix | Delete
} else {
[3322] Fix | Delete
$imagesize = @getimagesize( $file );
[3323] Fix | Delete
}
[3324] Fix | Delete
[3325] Fix | Delete
$mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false;
[3326] Fix | Delete
} else {
[3327] Fix | Delete
$mime = false;
[3328] Fix | Delete
}
[3329] Fix | Delete
[3330] Fix | Delete
if ( false !== $mime ) {
[3331] Fix | Delete
return $mime;
[3332] Fix | Delete
}
[3333] Fix | Delete
[3334] Fix | Delete
$magic = file_get_contents( $file, false, null, 0, 12 );
[3335] Fix | Delete
[3336] Fix | Delete
if ( false === $magic ) {
[3337] Fix | Delete
return false;
[3338] Fix | Delete
}
[3339] Fix | Delete
[3340] Fix | Delete
/*
[3341] Fix | Delete
* Add WebP fallback detection when image library doesn't support WebP.
[3342] Fix | Delete
* Note: detection values come from LibWebP, see
[3343] Fix | Delete
* https://github.com/webmproject/libwebp/blob/master/imageio/image_dec.c#L30
[3344] Fix | Delete
*/
[3345] Fix | Delete
$magic = bin2hex( $magic );
[3346] Fix | Delete
if (
[3347] Fix | Delete
// RIFF.
[3348] Fix | Delete
( str_starts_with( $magic, '52494646' ) ) &&
[3349] Fix | Delete
// WEBP.
[3350] Fix | Delete
( 16 === strpos( $magic, '57454250' ) )
[3351] Fix | Delete
) {
[3352] Fix | Delete
$mime = 'image/webp';
[3353] Fix | Delete
}
[3354] Fix | Delete
[3355] Fix | Delete
/**
[3356] Fix | Delete
* Add AVIF fallback detection when image library doesn't support AVIF.
[3357] Fix | Delete
*
[3358] Fix | Delete
* Detection based on section 4.3.1 File-type box definition of the ISO/IEC 14496-12
[3359] Fix | Delete
* specification and the AV1-AVIF spec, see https://aomediacodec.github.io/av1-avif/v1.1.0.html#brands.
[3360] Fix | Delete
*/
[3361] Fix | Delete
[3362] Fix | Delete
// Divide the header string into 4 byte groups.
[3363] Fix | Delete
$magic = str_split( $magic, 8 );
[3364] Fix | Delete
[3365] Fix | Delete
if (
[3366] Fix | Delete
isset( $magic[1] ) &&
[3367] Fix | Delete
isset( $magic[2] ) &&
[3368] Fix | Delete
'ftyp' === hex2bin( $magic[1] ) &&
[3369] Fix | Delete
( 'avif' === hex2bin( $magic[2] ) || 'avis' === hex2bin( $magic[2] ) )
[3370] Fix | Delete
) {
[3371] Fix | Delete
$mime = 'image/avif';
[3372] Fix | Delete
}
[3373] Fix | Delete
} catch ( Exception $e ) {
[3374] Fix | Delete
$mime = false;
[3375] Fix | Delete
}
[3376] Fix | Delete
[3377] Fix | Delete
return $mime;
[3378] Fix | Delete
}
[3379] Fix | Delete
[3380] Fix | Delete
/**
[3381] Fix | Delete
* Retrieves the list of mime types and file extensions.
[3382] Fix | Delete
*
[3383] Fix | Delete
* @since 3.5.0
[3384] Fix | Delete
* @since 4.2.0 Support was added for GIMP (.xcf) files.
[3385] Fix | Delete
* @since 4.9.2 Support was added for Flac (.flac) files.
[3386] Fix | Delete
* @since 4.9.6 Support was added for AAC (.aac) files.
[3387] Fix | Delete
*
[3388] Fix | Delete
* @return string[] Array of mime types keyed by the file extension regex corresponding to those types.
[3389] Fix | Delete
*/
[3390] Fix | Delete
function wp_get_mime_types() {
[3391] Fix | Delete
/**
[3392] Fix | Delete
* Filters the list of mime types and file extensions.
[3393] Fix | Delete
*
[3394] Fix | Delete
* This filter should be used to add, not remove, mime types. To remove
[3395] Fix | Delete
* mime types, use the {@see 'upload_mimes'} filter.
[3396] Fix | Delete
*
[3397] Fix | Delete
* @since 3.5.0
[3398] Fix | Delete
*
[3399] Fix | Delete
* @param string[] $wp_get_mime_types Mime types keyed by the file extension regex
[3400] Fix | Delete
* corresponding to those types.
[3401] Fix | Delete
*/
[3402] Fix | Delete
return apply_filters(
[3403] Fix | Delete
'mime_types',
[3404] Fix | Delete
array(
[3405] Fix | Delete
// Image formats.
[3406] Fix | Delete
'jpg|jpeg|jpe' => 'image/jpeg',
[3407] Fix | Delete
'gif' => 'image/gif',
[3408] Fix | Delete
'png' => 'image/png',
[3409] Fix | Delete
'bmp' => 'image/bmp',
[3410] Fix | Delete
'tiff|tif' => 'image/tiff',
[3411] Fix | Delete
'webp' => 'image/webp',
[3412] Fix | Delete
'avif' => 'image/avif',
[3413] Fix | Delete
'ico' => 'image/x-icon',
[3414] Fix | Delete
'heic' => 'image/heic',
[3415] Fix | Delete
// Video formats.
[3416] Fix | Delete
'asf|asx' => 'video/x-ms-asf',
[3417] Fix | Delete
'wmv' => 'video/x-ms-wmv',
[3418] Fix | Delete
'wmx' => 'video/x-ms-wmx',
[3419] Fix | Delete
'wm' => 'video/x-ms-wm',
[3420] Fix | Delete
'avi' => 'video/avi',
[3421] Fix | Delete
'divx' => 'video/divx',
[3422] Fix | Delete
'flv' => 'video/x-flv',
[3423] Fix | Delete
'mov|qt' => 'video/quicktime',
[3424] Fix | Delete
'mpeg|mpg|mpe' => 'video/mpeg',
[3425] Fix | Delete
'mp4|m4v' => 'video/mp4',
[3426] Fix | Delete
'ogv' => 'video/ogg',
[3427] Fix | Delete
'webm' => 'video/webm',
[3428] Fix | Delete
'mkv' => 'video/x-matroska',
[3429] Fix | Delete
'3gp|3gpp' => 'video/3gpp', // Can also be audio.
[3430] Fix | Delete
'3g2|3gp2' => 'video/3gpp2', // Can also be audio.
[3431] Fix | Delete
// Text formats.
[3432] Fix | Delete
'txt|asc|c|cc|h|srt' => 'text/plain',
[3433] Fix | Delete
'csv' => 'text/csv',
[3434] Fix | Delete
'tsv' => 'text/tab-separated-values',
[3435] Fix | Delete
'ics' => 'text/calendar',
[3436] Fix | Delete
'rtx' => 'text/richtext',
[3437] Fix | Delete
'css' => 'text/css',
[3438] Fix | Delete
'htm|html' => 'text/html',
[3439] Fix | Delete
'vtt' => 'text/vtt',
[3440] Fix | Delete
'dfxp' => 'application/ttaf+xml',
[3441] Fix | Delete
// Audio formats.
[3442] Fix | Delete
'mp3|m4a|m4b' => 'audio/mpeg',
[3443] Fix | Delete
'aac' => 'audio/aac',
[3444] Fix | Delete
'ra|ram' => 'audio/x-realaudio',
[3445] Fix | Delete
'wav' => 'audio/wav',
[3446] Fix | Delete
'ogg|oga' => 'audio/ogg',
[3447] Fix | Delete
'flac' => 'audio/flac',
[3448] Fix | Delete
'mid|midi' => 'audio/midi',
[3449] Fix | Delete
'wma' => 'audio/x-ms-wma',
[3450] Fix | Delete
'wax' => 'audio/x-ms-wax',
[3451] Fix | Delete
'mka' => 'audio/x-matroska',
[3452] Fix | Delete
// Misc application formats.
[3453] Fix | Delete
'rtf' => 'application/rtf',
[3454] Fix | Delete
'js' => 'application/javascript',
[3455] Fix | Delete
'pdf' => 'application/pdf',
[3456] Fix | Delete
'swf' => 'application/x-shockwave-flash',
[3457] Fix | Delete
'class' => 'application/java',
[3458] Fix | Delete
'tar' => 'application/x-tar',
[3459] Fix | Delete
'zip' => 'application/zip',
[3460] Fix | Delete
'gz|gzip' => 'application/x-gzip',
[3461] Fix | Delete
'rar' => 'application/rar',
[3462] Fix | Delete
'7z' => 'application/x-7z-compressed',
[3463] Fix | Delete
'exe' => 'application/x-msdownload',
[3464] Fix | Delete
'psd' => 'application/octet-stream',
[3465] Fix | Delete
'xcf' => 'application/octet-stream',
[3466] Fix | Delete
// MS Office formats.
[3467] Fix | Delete
'doc' => 'application/msword',
[3468] Fix | Delete
'pot|pps|ppt' => 'application/vnd.ms-powerpoint',
[3469] Fix | Delete
'wri' => 'application/vnd.ms-write',
[3470] Fix | Delete
'xla|xls|xlt|xlw' => 'application/vnd.ms-excel',
[3471] Fix | Delete
'mdb' => 'application/vnd.ms-access',
[3472] Fix | Delete
'mpp' => 'application/vnd.ms-project',
[3473] Fix | Delete
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
[3474] Fix | Delete
'docm' => 'application/vnd.ms-word.document.macroEnabled.12',
[3475] Fix | Delete
'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template',
[3476] Fix | Delete
'dotm' => 'application/vnd.ms-word.template.macroEnabled.12',
[3477] Fix | Delete
'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
[3478] Fix | Delete
'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12',
[3479] Fix | Delete
'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
[3480] Fix | Delete
'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template',
[3481] Fix | Delete
'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12',
[3482] Fix | Delete
'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12',
[3483] Fix | Delete
'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
[3484] Fix | Delete
'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12',
[3485] Fix | Delete
'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow',
[3486] Fix | Delete
'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12',
[3487] Fix | Delete
'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template',
[3488] Fix | Delete
'potm' => 'application/vnd.ms-powerpoint.template.macroEnabled.12',
[3489] Fix | Delete
'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12',
[3490] Fix | Delete
'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide',
[3491] Fix | Delete
'sldm' => 'application/vnd.ms-powerpoint.slide.macroEnabled.12',
[3492] Fix | Delete
'onetoc|onetoc2|onetmp|onepkg' => 'application/onenote',
[3493] Fix | Delete
'oxps' => 'application/oxps',
[3494] Fix | Delete
'xps' => 'application/vnd.ms-xpsdocument',
[3495] Fix | Delete
// OpenOffice formats.
[3496] Fix | Delete
'odt' => 'application/vnd.oasis.opendocument.text',
[3497] Fix | Delete
'odp' => 'application/vnd.oasis.opendocument.presentation',
[3498] Fix | Delete
'ods' => 'application/vnd.oasis.opendocument.spreadsheet',
[3499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function