From 7ad65267b61fb50e862433b4139cb63fd4fcfec2 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 6 Nov 2015 09:25:26 +0000 Subject: [PATCH] Media: Avoid a PHP warning in `wp_generate_attachment_metadata()` if `$metadata` is not an array. This was previously fixed in [25968], but accidentally reverted in [32545]. Props skithund. Fixes #34599. Built from https://develop.svn.wordpress.org/trunk@35554 git-svn-id: http://core.svn.wordpress.org/trunk@35518 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index d596db4dab..139d405070 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -194,7 +194,9 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) { } // Remove the blob of binary data from the array. - unset( $metadata['image']['data'] ); + if ( $metadata ) { + unset( $metadata['image']['data'] ); + } /** * Filter the generated attachment meta data. diff --git a/wp-includes/version.php b/wp-includes/version.php index 86dc47d401..f88d96fff5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta3-35553'; +$wp_version = '4.4-beta3-35554'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.