WordPress.org

WordPress build repository browser

Changeset 42497


Ignore:
Timestamp:
02/07/18 23:49:41 (2 weeks ago)
Author:
SergeyBiryukov
Message:

Media: Avoid a PHP warning in wp_calculate_image_srcset() if a plugin returns a non-array value via wp_calculate_image_srcset filter.

Props mrmadhat, codegrau.
Merges [42639] to the 4.9 branch.
Fixes #43201.
Built from https://develop.svn.wordpress.org/branches/4.9@42669

Location:
branches/4.9/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9/wp-includes/media.php

    r42282 r42497  
    12041204 
    12051205    // Only return a 'srcset' value if there is more than one source. 
    1206     if ( ! $src_matched || count( $sources ) < 2 ) { 
     1206    if ( ! $src_matched || ! is_array( $sources ) || count( $sources ) < 2 ) { 
    12071207        return false; 
    12081208    } 
  • branches/4.9/wp-includes/version.php

    r42496 r42497  
    55 * @global string $wp_version 
    66 */ 
    7 $wp_version = '4.9.5-alpha-42668'; 
     7$wp_version = '4.9.5-alpha-42669'; 
    88 
    99/** 
Note: See TracChangeset for help on using the changeset viewer.