From 64f2a546f083569b8a7c85313d8e323221c86266 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 11 May 2017 19:20:10 +0000 Subject: [PATCH] Themes: Avoid PHP warnings in the admin when no theme directory exists. Props iseulde, chris_dev, swissspidy. Fixes #35521. git-svn-id: https://develop.svn.wordpress.org/trunk@40636 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/theme-install.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index eb956f4380..dd9ff500d1 100644 --- a/src/wp-admin/theme-install.php +++ b/src/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 ] );