Make WordPress Core

Changeset 43039


Ignore:
Timestamp:
04/30/2018 04:50:52 AM (6 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.
Fixes #43374. See #40109.

File:
1 edited

Legend:

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

    r42871 r43039  
    371371    global $wp_theme_directories;
    372372
    373     if ( count( $wp_theme_directories ) <= 1 ) {
     373    if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
    374374        return '/themes';
    375375    }
Note: See TracChangeset for help on using the changeset viewer.