mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
General: Avoid counting uncountable values when reading theme directories, and in some unit tests.
See #40109 git-svn-id: https://develop.svn.wordpress.org/trunk@41174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -35,7 +35,7 @@ function wp_get_themes( $args = array() ) {
|
||||
|
||||
$theme_directories = search_theme_directories();
|
||||
|
||||
if ( count( $wp_theme_directories ) > 1 ) {
|
||||
if ( is_array( $wp_theme_directories ) && count( $wp_theme_directories ) > 1 ) {
|
||||
// Make sure the current theme wins out, in case search_theme_directories() picks the wrong
|
||||
// one in the case of a conflict. (Normally, last registered theme root wins.)
|
||||
$current_theme = get_stylesheet();
|
||||
@@ -627,8 +627,9 @@ function get_theme_root_uri( $stylesheet_or_template = false, $theme_root = fals
|
||||
function get_raw_theme_root( $stylesheet_or_template, $skip_cache = false ) {
|
||||
global $wp_theme_directories;
|
||||
|
||||
if ( count($wp_theme_directories) <= 1 )
|
||||
if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) {
|
||||
return '/themes';
|
||||
}
|
||||
|
||||
$theme_root = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user