WordPress.org

Make WordPress Core

Ticket #18785: 18785.11.diff

File 18785.11.diff, 581 bytes (added by ryan, 7 years ago)

Avoid fatals for plugins that erroneously include admin-header.php from an admin_init handler.

  • wp-admin/admin-header.php

     
    1414global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone,
    1515        $current_site, $update_title, $total_update_count, $parent_file;
    1616
     17// Catch plugins that include admin-header.php before admin.php completes.
     18if ( empty( $current_screen ) )
     19        set_current_screen();
     20
    1721get_admin_page_title();
    1822$title = esc_html( strip_tags( $title ) );
    1923