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
This commit is contained in:
Dominik Schilling 2016-11-16 20:12:31 +00:00
parent 7db38b916a
commit e4a83d2e6f
2 changed files with 4 additions and 2 deletions

View File

@ -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;

View File

@ -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.