WordPress.org

Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1/wp-includes/formatting.php

    r17571 r18031  
    719719            $allowed = false;
    720720            foreach ( $mimes as $ext_preg => $mime_match ) {
    721                 $ext_preg = '!(^' . $ext_preg . ')$!i';
     721                $ext_preg = '!^(' . $ext_preg . ')$!i';
    722722                if ( preg_match( $ext_preg, $part ) ) {
    723723                    $allowed = true;
     
    29042904}
    29052905
     2906/**
     2907 * Sanitize a mime type
     2908 *
     2909 * @since 3.1.3
     2910 *
     2911 * @param string $mime_type Mime type
     2912 * @return string Sanitized mime type
     2913 */
     2914function sanitize_mime_type( $mime_type ) {
     2915    $sani_mime_type = preg_replace( '/[^-*.a-zA-Z0-9\/]/', '', $mime_type );
     2916    return apply_filters( 'sanitize_mime_type', $sani_mime_type, $mime_type );
     2917}
     2918
    29062919?>
Note: See TracChangeset for help on using the changeset viewer.