From 9af735e8637841826a3a185c92daf596c283393a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 11 May 2017 19:21:44 +0000 Subject: [PATCH] Themes: Avoid PHP warnings in the admin when no theme directory exists. Props iseulde, chris_dev, swissspidy. Fixes #35521. Built from https://develop.svn.wordpress.org/trunk@40636 git-svn-id: http://core.svn.wordpress.org/trunk@40497 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/theme-install.php | 5 +++++ wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-admin/theme-install.php b/wp-admin/theme-install.php index eb956f4380..dd9ff500d1 100644 --- a/wp-admin/theme-install.php +++ b/wp-admin/theme-install.php @@ -28,6 +28,11 @@ if ( ! is_network_admin() ) { } $installed_themes = search_theme_directories(); + +if ( false === $installed_themes ) { + $installed_themes = array(); +} + foreach ( $installed_themes as $k => $v ) { if ( false !== strpos( $k, '/' ) ) { unset( $installed_themes[ $k ] ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a192803ea8..8ef2be3b8b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40635'; +$wp_version = '4.8-alpha-40636'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.