From b42b7b33a7175d3af2a92e225c4d51f44422bd92 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 25 Jun 2008 16:45:04 +0000 Subject: [PATCH] Image sideloader fix from noel. see #6813 git-svn-id: http://svn.automattic.com/wordpress/trunk@8192 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/file.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index d5b46ce7d5..349feb2e6a 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -285,7 +285,11 @@ function wp_handle_sideload( &$file, $overrides = false ) { return $upload_error_handler( $file, $uploads['error'] ); $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); - + + // Strip the query strings. + $filename = str_replace('?','-', $filename); + $filename = str_replace('&','-', $filename); + // Move the file to the uploads dir $new_file = $uploads['path'] . "/$filename"; if ( false === @ rename( $file['tmp_name'], $new_file ) ) {