From 2d1b0ab4c6708eb61acaef82a8b78d07ddb83bd7 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 7 Sep 2016 14:01:10 +0000 Subject: [PATCH] Media: Sanitize upload filename. Merge of [38538] to the 3.7 branch. Built from https://develop.svn.wordpress.org/branches/3.7@38548 git-svn-id: http://core.svn.wordpress.org/branches/3.7@38491 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 817bab9aa9..244cb54cdf 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -221,7 +221,7 @@ function media_handle_upload($file_id, $post_id, $post_data = array(), $override $url = $file['url']; $type = $file['type']; $file = $file['file']; - $title = $name; + $title = sanitize_title( $name ); $content = ''; if ( preg_match( '#^audio#', $type ) ) {