From bb6bf42e246c8cc267f163938ac18685b5c0fa77 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Fri, 6 Jan 2017 22:00:32 +0000 Subject: [PATCH] Media: Improved media titles when created from filename. Preserves spaces and generally creates more accurate, cleaner titles from filenames of uploaded media. Merge of [38615] to the 4.3 branch. Fixes #37989. Built from https://develop.svn.wordpress.org/branches/4.3@39713 git-svn-id: http://core.svn.wordpress.org/branches/4.3@39653 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 40e394a32b..2a7d6b5ab3 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -280,7 +280,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override $url = $file['url']; $type = $file['type']; $file = $file['file']; - $title = sanitize_title( $name ); + $title = sanitize_text_field( $name ); $content = ''; $excerpt = '';