Make WordPress Core

Ticket #43201: 43201.diff

File 43201.diff, 559 bytes (added by mrmadhat, 7 years ago)
  • src/wp-includes/media.php

     
    12051205        $sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $attachment_id );
    12061206
    12071207        // Only return a 'srcset' value if there is more than one source.
    1208         if ( ! $src_matched || count( $sources ) < 2 ) {
     1208        if ( ! $src_matched || ! is_array( $sources ) || count( $sources ) < 2 ) {
    12091209                return false;
    12101210        }
    12111211