From bb2de34edbf5cad4523487652156fb0d81e12a14 Mon Sep 17 00:00:00 2001 From: danielbachhuber Date: Wed, 31 Oct 2018 02:33:53 +0000 Subject: [PATCH] l10n: Avoid calling `is_user_logged_in()` in `determine_locale()`. `is_user_logged_in()` is a pluggable function, and loaded after plugins are loaded. If a plugin calls `__()` too early, `is_user_logged_in()` is missing and WordPress will fatal. `get_user_locale()` already handles this scenario for us, so it's safe to rely on exclusively. See #44758. Fixes #45235. Built from https://develop.svn.wordpress.org/branches/5.0@43846 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43675 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/l10n.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 8df78717d5..d0b2f38b98 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -134,7 +134,7 @@ function determine_locale() { $determined_locale = get_user_locale(); } - if ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() && is_user_logged_in() ) { + if ( isset( $_GET['_locale'] ) && 'user' === $_GET['_locale'] && wp_is_json_request() ) { $determined_locale = get_user_locale(); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 34ef9998d7..839ec1d799 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '5.0-beta2-43845'; +$wp_version = '5.0-beta2-43846'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.