sanitize_mime_type( string $mime_type ): string

Sanitizes a mime type

Parameters

$mime_typestringrequired
Mime type.

Return

string Sanitized mime type.

Source


/**
 * Sanitizes a mime type
 *
 * @since 3.1.3
 *
 * @param string $mime_type Mime type.
 * @return string Sanitized mime type.
 */
function sanitize_mime_type( $mime_type ) {
	$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
	/**

Changelog

VersionDescription
3.1.3Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.