Skip to content
Permalink
Browse files

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.
See #45668.



git-svn-id: https://develop.svn.wordpress.org/branches/5.0@44284 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information...
pento committed Dec 18, 2018
1 parent 8afa10d commit 3422c59710103d175ba1622eab706d984c82ace3
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/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'] );
}

0 comments on commit 3422c59

Please sign in to comment.
You can’t perform that action at this time.