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
This commit is contained in:
Sergey Biryukov 2018-04-30 04:55:26 +00:00
parent f04d84149f
commit cf7288a673
2 changed files with 3 additions and 2 deletions

View File

@ -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 ) {

View File

@ -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.