diff --git a/src/wp-includes/l10n.php b/src/wp-includes/l10n.php index 1a0474f465..b7d9d24af0 100644 --- a/src/wp-includes/l10n.php +++ b/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'] ); }