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
This commit is contained in:
Andrew Nacin
2014-09-03 08:02:53 +00:00
parent acbd7696ee
commit de3b2ccf19
2 changed files with 9 additions and 2 deletions

View File

@@ -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':