Ticket #11887: bmb_0008_t11887.patch
File bmb_0008_t11887.patch, 2.2 KB (added by , 13 years ago) |
---|
-
wp-includes/media.php
137 137 $meta = wp_get_attachment_metadata($id); 138 138 $width = $height = 0; 139 139 $is_intermediate = false; 140 $img_url_basename = substr(basename(str_replace('\\','\\a',str_replace('/','/a',$img_url))),1); 140 141 141 142 // plugins can use this to provide resize services 142 143 if ( $out = apply_filters('image_downsize', false, $id, $size) ) … … 144 145 145 146 // try for a new style intermediate size 146 147 if ( $intermediate = image_get_intermediate_size($id, $size) ) { 147 $img_url = str_replace( basename($img_url), $intermediate['file'], $img_url);148 $img_url = str_replace($img_url_basename, $intermediate['file'], $img_url); 148 149 $width = $intermediate['width']; 149 150 $height = $intermediate['height']; 150 151 $is_intermediate = true; … … 152 153 elseif ( $size == 'thumbnail' ) { 153 154 // fall back to the old thumbnail 154 155 if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { 155 $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url); 156 $thumb_file_basename = substr(basename(str_replace('\\','\\a',str_replace('/','/a',$thumb_file))),1); 157 $img_url = str_replace($img_url_basename, $thumb_file_basename, $img_url); 156 158 $width = $info[0]; 157 159 $height = $info[1]; 158 160 $is_intermediate = true; … … 412 414 $info = pathinfo($file); 413 415 $dir = $info['dirname']; 414 416 $ext = $info['extension']; 415 $name = basename($file, ".{$ext}");417 $name = substr(basename(str_replace('\\','\\a',str_replace('/','/a',$file)), ".{$ext}"),1); 416 418 if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) ) 417 419 $dir = $_dest_path; 418 420 $destfilename = "{$dir}/{$name}-{$suffix}.{$ext}"; … … 461 463 if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) { 462 464 $resized_file = apply_filters('image_make_intermediate_size', $resized_file); 463 465 return array( 464 'file' => basename( $resized_file),466 'file' => substr(basename(str_replace('\\','\\a',str_replace('/','/a',$resized_file))),1), 465 467 'width' => $info[0], 466 468 'height' => $info[1], 467 469 );