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
This commit is contained in:
Andrew Nacin 2014-09-03 08:03:16 +00:00
parent 8a9186b878
commit 9db108dbe0
2 changed files with 9 additions and 2 deletions

View File

@ -305,7 +305,10 @@ endfor;
<?php <?php
$languages = get_available_languages(); $languages = get_available_languages();
if ( ! empty( $languages ) ) { if ( ! is_multisite() && defined( 'WPLANG' ) && '' !== WPLANG && 'en_US' !== WPLANG && ! in_array( WPLANG, $languages ) ) {
$languages[] = WPLANG;
}
if ( $languages ) {
?> ?>
<tr> <tr>
<th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th> <th width="33%" scope="row"><label for="WPLANG"><?php _e( 'Site Language' ); ?></label></th>

View File

@ -3361,8 +3361,12 @@ function sanitize_option($option, $value) {
case 'WPLANG': case 'WPLANG':
$allowed = get_available_languages(); $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 ); $value = get_option( $option );
}
break; break;
case 'illegal_names': case 'illegal_names':