Make WordPress Core


Ignore:
Timestamp:
03/29/2013 08:51:35 PM (13 years ago)
Author:
markjaquith
Message:

Sanity checks on image metadata to avoid warnings, etc.

fixes #23733. props wonderboymusic.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-header.php

    r23554 r23873  
    664664        } else {
    665665            $data = wp_get_attachment_metadata( $attachment_id );
    666             $height = $data[ 'height' ];
    667             $width = $data[ 'width' ];
     666            $height = isset( $data[ 'height' ] ) ? $data[ 'height' ] : 0;
     667            $width = isset( $data[ 'width' ] ) ? $data[ 'width' ] : 0;
    668668            unset( $data );
    669669        }
Note: See TracChangeset for help on using the changeset viewer.