WordPress.org

Make WordPress Core

Ticket #35521: 35521.diff

File 35521.diff, 645 bytes (added by swissspidy, 3 years ago)
  • src/wp-admin/theme-install.php

    diff --git src/wp-admin/theme-install.php src/wp-admin/theme-install.php
    index b3eff07ae8..6db6d3b708 100644
    if ( ! is_network_admin() ) { 
    2828}
    2929
    3030$installed_themes = search_theme_directories();
    31 foreach ( $installed_themes as $k => $v ) {
    32         if ( false !== strpos( $k, '/' ) ) {
    33                 unset( $installed_themes[ $k ] );
     31
     32if ( false === $installed_themes ) {
     33        $installed_themes = array();
     34}
     35
     36if ( $installed_themes ) {
     37        foreach ( $installed_themes as $k => $v ) {
     38                if ( false !== strpos( $k, '/' ) ) {
     39                        unset( $installed_themes[ $k ] );
     40                }
    3441        }
    3542}
    3643