From cf7288a673ed4453d6ba945294198bebed686a02 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 30 Apr 2018 04:55:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/branches/4.9@43040 git-svn-id: http://core.svn.wordpress.org/branches/4.9@42869 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index 4e5f63bb8e..947226c4d4 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -353,8 +353,9 @@ function get_template_directory_uri() { function get_theme_roots() { global $wp_theme_directories; - if ( count($wp_theme_directories) <= 1 ) + if ( ! is_array( $wp_theme_directories ) || count( $wp_theme_directories ) <= 1 ) { return '/themes'; + } $theme_roots = get_site_transient( 'theme_roots' ); if ( false === $theme_roots ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index e62e27bf6d..15b430e47e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.9.6-alpha-43038'; +$wp_version = '4.9.6-alpha-43040'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.