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.
Built from https://develop.svn.wordpress.org/trunk@47220


git-svn-id: http://core.svn.wordpress.org/trunk@47020 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-02-09 17:08:03 +00:00
parent 641c632b0c
commit 9429c8436d
2 changed files with 2 additions and 2 deletions

View File

@ -181,7 +181,7 @@ if ( isset( $plugin_page ) ) {
$page_hook = get_plugin_page_hook( $plugin_page, $plugin_page ); $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page );
// Back-compat for plugins using add_management_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. // There could be plugin specific params on the URL, so we need the whole query string.
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
$query_string = $_SERVER['QUERY_STRING']; $query_string = $_SERVER['QUERY_STRING'];

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.4-alpha-47219'; $wp_version = '5.4-alpha-47220';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.