From 8cbfdbaa0957c55383e771bdd135aae381eceecf Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 9 Feb 2020 17:06:55 +0000 Subject: [PATCH] Coding Standards: Correct the `get_plugin_page_hook()` check in `wp-admin/admin.php`. The condition is meant to check for a non-empty string, however `get_plugin_page_hook()` can return null, in which case the strict check doesn't work as expected. Follow-up to [47218]. See #48455, #49222. git-svn-id: https://develop.svn.wordpress.org/trunk@47220 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/admin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/admin.php b/src/wp-admin/admin.php index 7b703caff9..287027f4f6 100644 --- a/src/wp-admin/admin.php +++ b/src/wp-admin/admin.php @@ -181,7 +181,7 @@ if ( isset( $plugin_page ) ) { $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page ); // Back-compat for plugins using add_management_page(). - if ( empty( $page_hook ) && 'edit.php' === $pagenow && '' !== get_plugin_page_hook( $plugin_page, 'tools.php' ) ) { + if ( empty( $page_hook ) && 'edit.php' === $pagenow && get_plugin_page_hook( $plugin_page, 'tools.php' ) ) { // There could be plugin specific params on the URL, so we need the whole query string. if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { $query_string = $_SERVER['QUERY_STRING'];