WordPress.org

Make WordPress Core

Changeset 44284


Ignore:
Timestamp:
12/18/2018 03:39:14 AM (11 months ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/l10n.php

    r44232 r44284  
    139139    }
    140140
    141     if ( ! empty( $_GET['wp_lang'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {
     141    if ( ! empty( $_GET['wp_lang'] ) && ! empty( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow'] ) {
    142142        $determined_locale = sanitize_text_field( $_GET['wp_lang'] );
    143143    }
Note: See TracChangeset for help on using the changeset viewer.