From 917e03d25bbb082cc20eee5113d362804926d1d1 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Wed, 30 Sep 2009 23:39:09 +0000 Subject: [PATCH] Image Editor: fix refreshing of the thumbnail, use WP_Http_Fopen::test(), see #10528 git-svn-id: https://develop.svn.wordpress.org/trunk@11985 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/image-edit.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index dcc0a6cc9d..936f093fae 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -218,7 +218,7 @@ function load_image_to_edit($post_id, $mime_type, $size = 'full') { if ( $filepath && file_exists($filepath) ) { if ( 'full' != $size && ( $data = image_get_intermediate_size($post_id, $size) ) ) $filepath = path_join( dirname($filepath), $data['file'] ); - } elseif ( function_exists('fopen') ) { + } elseif ( WP_Http_Fopen::test() ) { $filepath = wp_get_attachment_url($post_id); } @@ -627,10 +627,11 @@ function wp_save_image($post_id) { update_post_meta( $post_id, '_wp_attachment_backup_sizes', $backup_sizes); if ( $target == 'thumbnail' || $target == 'all' || $target == 'full' ) { - if ( $thumb = $meta['sizes']['thumbnail'] ) { - $file_url = wp_get_attachment_url($post_id); + $file_url = wp_get_attachment_url($post_id); + if ( $thumb = $meta['sizes']['thumbnail'] ) $return->thumbnail = path_join( dirname($file_url), $thumb['file'] ); - } + else + $return->thumbnail = "$file_url?w=128&h=128"; } } else { $delete = true;