diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index c6dcc56052..fdfeb38019 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1877,6 +1877,7 @@ function wp_handle_upload(&$file, $overrides = false) { else $filename = str_replace("$number$ext", ++$number . $ext, $filename); } + $filename = preg_replace('#\.(?![^.]+$)#', '-', $filename); } // Move the file to the uploads dir