X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/1c09677af04c9e37714e09b73eb9dbc5b2e3eb13..849f15aeed7a5e39314057bdc0064d8edd60dd7d:/wp-admin/includes/image-edit.php?ds=sidebyside diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index b15575ae..7e3e7f7e 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -6,6 +6,10 @@ * @subpackage Administration */ +/** + * @param int $post_id + * @param bool|object $msg + */ function wp_image_editor($post_id, $msg = false) { $nonce = wp_create_nonce("image_editor-$post_id"); $meta = wp_get_attachment_metadata($post_id); @@ -13,7 +17,7 @@ function wp_image_editor($post_id, $msg = false) { $sub_sizes = isset($meta['sizes']) && is_array($meta['sizes']); $note = ''; - if ( is_array($meta) && isset($meta['width']) ) + if ( isset( $meta['width'], $meta['height'] ) ) $big = max( $meta['width'], $meta['height'] ); else die( __('Image data does not exist. Please re-upload the image.') ); @@ -21,8 +25,9 @@ function wp_image_editor($post_id, $msg = false) { $sizer = $big > 400 ? 400 / $big : 1; $backup_sizes = get_post_meta( $post_id, '_wp_attachment_backup_sizes', true ); - $can_restore = !empty($backup_sizes) && isset($backup_sizes['full-orig']) - && $backup_sizes['full-orig']['file'] != basename($meta['file']); + $can_restore = false; + if ( ! empty( $backup_sizes ) && isset( $backup_sizes['full-orig'], $meta['file'] ) ) + $can_restore = $backup_sizes['full-orig']['file'] != basename( $meta['file'] ); if ( $msg ) { if ( isset($msg->error) ) @@ -33,101 +38,59 @@ function wp_image_editor($post_id, $msg = false) { ?>
-
-
-
+
-
-
- )" disabled="disabled" class="button-primary imgedit-submit-btn" value="" />
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
|