Make WordPress Core

Changeset 44317


Ignore:
Timestamp:
12/19/2018 12:14:00 AM (6 years ago)
Author:
SergeyBiryukov
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.
Merges [44284] to trunk.
Fixes #45668.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/wp-includes/l10n.php

    r44316 r44317  
    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.