Ticket #18785: 18785.11.diff

File 18785.11.diff, 581 bytes (added by ryan, 18 months ago)

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

Line 
1Index: wp-admin/admin-header.php
2===================================================================
3--- wp-admin/admin-header.php   (revision 19303)
4+++ wp-admin/admin-header.php   (working copy)
5@@ -14,6 +14,10 @@
6 global $title, $hook_suffix, $current_screen, $wp_locale, $pagenow, $wp_version, $is_iphone,
7        $current_site, $update_title, $total_update_count, $parent_file;
8 
9+// Catch plugins that include admin-header.php before admin.php completes.
10+if ( empty( $current_screen ) )
11+       set_current_screen();
12+
13 get_admin_page_title();
14 $title = esc_html( strip_tags( $title ) );
15