Ticket #2166: 2166.diff
| File 2166.diff, 2.2 KB (added by davidhouse, 6 years ago) |
|---|
-
wp-admin/inline-uploading.php
86 86 87 87 if ( @file_exists($thumb) ) { 88 88 $newdata = $imagedata; 89 $newdata['thumb'] = basename($thumb);89 $newdata['thumb'] = rawurlencode(basename($thumb)); 90 90 update_post_meta($id, '_wp_attachment_metadata', $newdata, $imagedata); 91 91 } else { 92 92 $error = $thumb; … … 215 215 $uwidth_sum += 128; 216 216 if ( preg_match('!^image/!', $attachment['post_mime_type'] ) ) { 217 217 $image = & $attachment; 218 if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'. $image['thumb']) ) {218 if ( ($image['width'] > 128 || $image['height'] > 96) && !empty($image['thumb']) && file_exists(dirname($image['file']).'/'.rawurldecode($image['thumb'])) ) { 219 219 $src = str_replace(basename($image['guid']), $image['thumb'], $image['guid']); 220 220 $script .= "srca[{$ID}] = '$src'; 221 221 srcb[{$ID}] = '{$image['guid']}'; -
wp-admin/admin-functions.php
743 743 @ imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1]); 744 744 745 745 // If no filters change the filename, we'll do a default transformation. 746 if ( basename($file) == $thumb = apply_filters('thumbnail_filename', basename($file)) ) 746 $thumb = apply_filters('thumbnail_filename', basename($file)); 747 if ( basename($file) == $thumb) 747 748 $thumb = preg_replace('!(\.[^.]+)?$!', __('.thumbnail').'$1', basename($file), 1); 748 749 749 750 $thumbpath = str_replace(basename($file), $thumb, $file); … … 764 765 $error = __("Thumbnail path invalid"); 765 766 } 766 767 } 767 768 768 } 769 769 } else { 770 770 $error = __('File not found'); … … 1773 1773 @ chmod($new_file, $perms); 1774 1774 1775 1775 // Compute the URL 1776 $url = $uploads['url'] . "/ $filename";1776 $url = $uploads['url'] . "/" . rawurlencode($filename); 1777 1777 1778 1778 return array('file' => $new_file, 'url' => $url, 'type' => $type); 1779 1779 }
