Tag: WordPress/プラグイン
//Fix for checking file extensions $exts = explode(".",$filename); if(count($exts)>2)return null; $allowed=get_allowed_mime_types(); $ext=pathinfo($new_file,PATHINFO_EXTENSION); if(!array_key_exists($ext,$allowed))return null;
function split_combined_mimes_for_apt( $mime_types ) { foreach ( $mime_types as $regex => $mime_type ) { if ( false !== strpos( $regex, '|' ) ) { $keys = explode( '|', $regex ); foreach ( $keys as $key ) { $mime_types[ $key ] = $mime_type; } } } return $mime_types; } add_filter( 'mime_types', 'split_combined_mimes_for_apt' );