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.0 branch.

Fixes #37989.

Built from https://develop.svn.wordpress.org/branches/4.0@39716


git-svn-id: http://core.svn.wordpress.org/branches/4.0@39656 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Joe McGill 2017-01-06 22:01:43 +00:00
parent 600bd299c2
commit e21c149861
1 changed files with 1 additions and 1 deletions

View File

@ -263,7 +263,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override
$url = $file['url']; $url = $file['url'];
$type = $file['type']; $type = $file['type'];
$file = $file['file']; $file = $file['file'];
$title = sanitize_title( $name ); $title = sanitize_text_field( $name );
$content = ''; $content = '';
if ( preg_match( '#^audio#', $type ) ) { if ( preg_match( '#^audio#', $type ) ) {