Make WordPress Core

Changeset 43040


Ignore:
Timestamp:
04/30/2018 04:54:54 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Themes: Avoid a PHP 7.2 warning in get_theme_roots() when $wp_theme_directories is an uncountable value.

See [41174] for wp_get_themes() and get_raw_theme_root().

Props burlingtonbytes, teddytime, lbenicio, desrosj.
Merges [43039] to the 4.9 branch.
Fixes #43374. See #40109.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/theme.php

    r41995 r43040  
    354354    global $wp_theme_directories;
    355355
    356     if ( count($wp_theme_directories) <= 1 )
     356    if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
    357357        return '/themes';
     358    }
    358359
    359360    $theme_roots = get_site_transient( 'theme_roots' );
Note: See TracChangeset for help on using the changeset viewer.