Make WordPress Core

Ticket #5449: 5449.wp-app.content-type.diff

File 5449.wp-app.content-type.diff, 565 bytes (added by DD32, 17 years ago)
  • wp-app.php

     
    403403                        $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] );
    404404                elseif ( empty( $slug ) ) // just make a random name
    405405                        $slug = substr( md5( uniqid( microtime() ) ), 0, 7);
    406                 $ext = preg_replace( '|.*/([a-z]+)|', '$1', $_SERVER['CONTENT_TYPE'] );
     406                $ext = preg_replace( '|.*/(\w+)|', '$1', $_SERVER['CONTENT_TYPE'] );
    407407                $slug = "$slug.$ext";
    408408                $file = wp_upload_bits( $slug, NULL, $bits);
    409409