WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/06/2015 09:24:36 AM (5 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r34378 r35554  
    195195
    196196    // Remove the blob of binary data from the array.
    197     unset( $metadata['image']['data'] );
     197    if ( $metadata ) {
     198        unset( $metadata['image']['data'] );
     199    }
    198200
    199201    /**
Note: See TracChangeset for help on using the changeset viewer.