From c2c5d304100b11d458aa42f06d8210bcc0128327 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 19 Dec 2018 03:33:56 +0000 Subject: [PATCH] i18n: Prevent a PHP warning when a mu-plugin loads a textdomain. `determine_locale()` accesses the `$pagenow` global, but this is set after mu-plugins are loaded, so we need to check that it's been set. Props swissspidy, azaozz. Merges [44284] to trunk. Fixes #45668. Built from https://develop.svn.wordpress.org/trunk@44317 git-svn-id: http://core.svn.wordpress.org/trunk@44147 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 1a0474f465..b7d9d24af0 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -138,7 +138,7 @@ function determine_locale() { $determined_locale = get_user_locale(); } - if ( ! empty( $_GET['wp_lang'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) { + if ( ! empty( $_GET['wp_lang'] ) && ! empty( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) { $determined_locale = sanitize_text_field( $_GET['wp_lang'] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 6a25caa58d..fc875dbc0b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.1-alpha-44316'; +$wp_version = '5.1-alpha-44317'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.