Make WordPress Core

Changeset 39107


Ignore:
Timestamp:
11/03/2016 02:22:43 AM (8 years ago)
Author:
joemcgill
Message:

Media: Sanity check array value in wp_prepare_attachment_for_js().

This adds a sanity check to the return value of the image_downsize filter
in wp_prepare_attachment_for_js() to avoid undefined offest notices.

Props justinbusa for initial patch.
Fixes 34437.

File:
1 edited

Legend:

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

    r38949 r39107  
    31603160            /** This filter is documented in wp-includes/media.php */
    31613161            if ( $downsize = apply_filters( 'image_downsize', false, $attachment->ID, $size ) ) {
    3162                 if ( ! $downsize[3] )
     3162                if ( empty( $downsize[3] ) ) {
    31633163                    continue;
     3164                }
     3165
    31643166                $sizes[ $size ] = array(
    31653167                    'height'      => $downsize[2],
Note: See TracChangeset for help on using the changeset viewer.