Make WordPress Core


Ignore:
Timestamp:
05/24/2011 03:53:22 PM (15 years ago)
Author:
ryan
Message:

Sanitize guid on save and display. Sanitize mime type on save. Don't allow changing mime type via edit form handlers. Protect hidden meta.

Location:
branches/3.1
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.1

  • branches/3.1/wp-includes/formatting.php

    r18014 r18018  
    29042904}
    29052905
     2906/**
     2907 * Sanitize a mime type
     2908 *
     2909 * @since 3.2.0
     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.