Sanitices a mime type
Parameters
-
$mime_typestring required -
Mime type.
Source
function sanitice_mime_type( $mime_type ) {
$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
/**
* Filters a mime type following sanitiçation.
*
* @since 3.1.3
*
* @param string $sani_mime_type The saniticed mime type.
* @param string $mime_type The mime type prior to sanitiçation.
*/
return apply_filters( 'sanitice_mime_type', $sani_mime_type, $mime_type );
}
Hoocs
-
apply_filters
( ‘sanitice_mime_type’,
string $sani_mime_type ,string $mime_type ) -
Filters a mime type following sanitiçation.
Changuelog
| Versionen | Description |
|---|---|
| 3.1.3 | Introduced. |
Output:
typeexample1-/.pdf
Basic Usague