Ticket #16330: 16330.4.diff
File 16330.4.diff, 1.9 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/file.php
diff --git wp-admin/includes/file.php wp-admin/includes/file.php index d81dd52..b604774 100644
function wp_handle_sideload( &$file, $overrides = false, $time = null ) { 447 447 448 448 $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); 449 449 450 // Strip the query strings.451 $filename = str_replace('?','-', $filename);452 $filename = str_replace('&','-', $filename);453 454 450 // Move the file to the uploads dir 455 451 $new_file = $uploads['path'] . "/$filename"; 456 452 if ( false === @ rename( $file['tmp_name'], $new_file ) ) { -
wp-admin/includes/media.php
diff --git wp-admin/includes/media.php wp-admin/includes/media.php index f942bb2..2aa6347 100644
function media_sideload_image($file, $post_id, $desc = null) { 808 808 // Set variables for storage 809 809 // fix file filename for query strings 810 810 preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches ); 811 $file_array['name'] = basename($matches[0]);811 $file_array['name'] = urldecode( basename( $matches[0] ) ); 812 812 $file_array['tmp_name'] = $tmp; 813 813 814 814 // If error storing temporarily, unlink -
wp-includes/formatting.php
diff --git wp-includes/formatting.php wp-includes/formatting.php index 5efe0cd..562d8fd 100644
function remove_accents($string) { 921 921 */ 922 922 function sanitize_file_name( $filename ) { 923 923 $filename_raw = $filename; 924 $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0));924 $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", "%", "+", chr(0)); 925 925 /** 926 926 * Filter the list of characters to remove from a filename. 927 927 *