Ticket #5449: 5449.wp-app.content-type.diff
File 5449.wp-app.content-type.diff, 565 bytes (added by , 17 years ago) |
---|
-
wp-app.php
403 403 $slug = sanitize_file_name( $_SERVER['HTTP_TITLE'] ); 404 404 elseif ( empty( $slug ) ) // just make a random name 405 405 $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'] ); 407 407 $slug = "$slug.$ext"; 408 408 $file = wp_upload_bits( $slug, NULL, $bits); 409 409