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

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