From e4a83d2e6f3d8b658c07cf20b5d41d36e3994da3 Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Wed, 16 Nov 2016 20:12:31 +0000 Subject: [PATCH] Users: In `edit_user()` fall back to site's locale instead of `en_US` for invalid user locales. See #38632, #29783. Fixes #38798. Built from https://develop.svn.wordpress.org/trunk@39269 git-svn-id: http://core.svn.wordpress.org/trunk@39209 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/user.php | 4 +++- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/user.php b/wp-admin/includes/user.php index e5f84fa316..d962717a0d 100644 --- a/wp-admin/includes/user.php +++ b/wp-admin/includes/user.php @@ -100,8 +100,10 @@ function edit_user( $user_id = 0 ) { $locale = sanitize_text_field( $_POST['locale'] ); if ( 'site-default' === $locale ) { $locale = ''; - } elseif ( ! in_array( $locale, get_available_languages(), true ) ) { + } elseif ( '' === $locale ) { $locale = 'en_US'; + } elseif ( ! in_array( $locale, get_available_languages(), true ) ) { + $locale = ''; } $user->locale = $locale; diff --git a/wp-includes/version.php b/wp-includes/version.php index 64d95e4014..7765ef1282 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-beta4-39268'; +$wp_version = '4.7-beta4-39269'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.