diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 35aa7914c7..1405e85334 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -278,18 +278,17 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override $time = $post->post_date; } - $name = $_FILES[$file_id]['name']; $file = wp_handle_upload($_FILES[$file_id], $overrides, $time); if ( isset($file['error']) ) return new WP_Error( 'upload_error', $file['error'] ); - $basename = pathinfo( $name, PATHINFO_BASENAME ); + $name = pathinfo( $_FILES[$file_id]['name'], PATHINFO_FILENAME ); $url = $file['url']; $type = $file['type']; $file = $file['file']; - $title = sanitize_title( $basename ); + $title = sanitize_text_field( $name ); $content = ''; $excerpt = ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index d3c05840eb..5e48574602 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38613'; +$wp_version = '4.7-alpha-38614'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.