From de3b2ccf19bbd5c0ea86436ccf91ac643413f369 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 3 Sep 2014 08:02:53 +0000 Subject: [PATCH] Allow language specified by the WPLANG constant (but not installed) to be chosen. fixes #29456. git-svn-id: https://develop.svn.wordpress.org/trunk@29691 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/options-general.php | 5 ++++- src/wp-includes/formatting.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php index 4ad97a531b..7011885553 100644 --- a/src/wp-admin/options-general.php +++ b/src/wp-admin/options-general.php @@ -305,7 +305,10 @@ endfor; diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 3828c6abc2..f307a54330 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -3361,8 +3361,12 @@ function sanitize_option($option, $value) { case 'WPLANG': $allowed = get_available_languages(); - if ( ! in_array( $value, $allowed ) && ! empty( $value ) ) + if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG ) { + $allowed[] = WPLANG; + } + if ( ! in_array( $value, $allowed ) && ! empty( $value ) ) { $value = get_option( $option ); + } break; case 'illegal_names':