function sanitize_mime_type( $mime_type ) {}

Sanitize a mime type


  • string $mime_type: Mime type

Return values

returns:Sanitized mime type

Defined filters

  • sanitize_mime_type
    apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type )

Source code

function sanitize_mime_type( $mime_type ) {

	$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );

	return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );



No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: