Make WordPress Core


Ignore:
Timestamp:
07/27/2017 04:59:36 PM (7 years ago)
Author:
johnbillion
Message:

General: Avoid counting uncountable values when reading theme directories, and in some unit tests.

See #40109

File:
1 edited

Legend:

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

    r41168 r41174  
    3636    $theme_directories = search_theme_directories();
    3737
    38     if ( count( $wp_theme_directories ) > 1 ) {
     38    if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
    3939        // Make sure the current theme wins out, in case search_theme_directories() picks the wrong
    4040        // one in the case of a conflict. (Normally, last registered theme root wins.)
     
    628628    global $wp_theme_directories;
    629629
    630     if ( count($wp_theme_directories) <= 1 )
     630    if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
    631631        return '/themes';
     632    }
    632633
    633634    $theme_root = false;
Note: See TracChangeset for help on using the changeset viewer.