WordPress.org

Make WordPress Core

Ticket #19244: 19244.patch

File 19244.patch, 1.7 KB (added by SergeyBiryukov, 3 years ago)
  • wp-admin/includes/theme.php

     
    145145                return get_themes(); 
    146146 
    147147        $themes = get_themes(); 
     148        if ( !is_array( $themes ) ) 
     149                return false; 
     150 
    148151        $ct = current_theme_info(); 
    149152        $allowed_themes = apply_filters("allowed_themes", get_site_allowed_themes() ); 
    150153        if ( $allowed_themes == false ) 
     
    176179 */ 
    177180function get_page_templates() { 
    178181        $themes = get_themes(); 
     182        if ( !is_array( $themes ) ) 
     183                return array(); 
     184 
    179185        $theme = get_current_theme(); 
    180186        $templates = $themes[$theme]['Template Files']; 
    181187        $page_templates = array(); 
  • wp-admin/includes/update.php

     
    221221        $current = get_site_transient('update_themes'); 
    222222        $update_themes = array(); 
    223223 
    224         foreach ( $themes as $theme ) { 
     224        foreach ( (array) $themes as $theme ) { 
    225225                $theme = (object) $theme; 
    226226                if ( isset($current->response[ $theme->Stylesheet ]) ) { 
    227227                        $update_themes[$theme->Stylesheet] = $theme; 
  • wp-includes/theme.php

     
    480480        $theme_roots = get_site_transient( 'theme_roots' ); 
    481481        if ( false === $theme_roots ) { 
    482482                get_themes(); 
    483                 $theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_theme() 
     483                $theme_roots = get_site_transient( 'theme_roots' ); // this is set in get_themes() 
    484484        } 
    485485        return $theme_roots; 
    486486}