From 9db108dbe06f5509d887b704cc7e03824f350ad2 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 3 Sep 2014 08:03:16 +0000 Subject: [PATCH] Allow language specified by the WPLANG constant (but not installed) to be chosen. fixes #29456. Built from https://develop.svn.wordpress.org/trunk@29691 git-svn-id: http://core.svn.wordpress.org/trunk@29466 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/options-general.php | 5 ++++- wp-includes/formatting.php | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/wp-admin/options-general.php b/wp-admin/options-general.php index 4ad97a531b..7011885553 100644 --- a/wp-admin/options-general.php +++ b/wp-admin/options-general.php @@ -305,7 +305,10 @@ endfor; diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 3828c6abc2..f307a54330 100644 --- a/wp-includes/formatting.php +++ b/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':