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.

git-svn-id: https://develop.svn.wordpress.org/trunk@35554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2015-11-06 09:24:36 +00:00
parent 22135794a2
commit 5e614a08f8

View File

@ -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.