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.

git-svn-id: https://develop.svn.wordpress.org/trunk@44317 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2018-12-19 00:14:00 +00:00
parent 3d780791a3
commit 72405a0eba
1 changed files with 1 additions and 1 deletions

View File

@ -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'] );
}