Avoid a PHP notice in `wp_install_language_form()` and `wp_dropdown_languages()` if the language doesn't have a ISO 639-1 code.

props barrykooij.
fixes #31319.
Built from https://develop.svn.wordpress.org/trunk@31447


git-svn-id: http://core.svn.wordpress.org/trunk@31428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-02-13 11:23:26 +00:00
parent 7b9d981a54
commit e2f5a8094e
3 changed files with 5 additions and 5 deletions

View File

@ -141,7 +141,7 @@ function wp_install_language_form( $languages ) {
$language = $languages[ $wp_local_package ];
printf( '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
esc_attr( $language['language'] ),
esc_attr( $language['iso'][1] ),
esc_attr( current( $language['iso'] ) ),
esc_attr( $language['strings']['continue'] ),
in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
esc_html( $language['native_name'] ) );
@ -153,7 +153,7 @@ function wp_install_language_form( $languages ) {
foreach ( $languages as $language ) {
printf( '<option value="%s" lang="%s" data-continue="%s"%s>%s</option>' . "\n",
esc_attr( $language['language'] ),
esc_attr( $language['iso'][1] ),
esc_attr( current( $language['iso'] ) ),
esc_attr( $language['strings']['continue'] ),
in_array( $language['language'], $installed_languages ) ? ' data-installed="1"' : '',
esc_html( $language['native_name'] ) );

View File

@ -896,7 +896,7 @@ function wp_dropdown_languages( $args = array() ) {
$languages[] = array(
'language' => $translation['language'],
'native_name' => $translation['native_name'],
'lang' => $translation['iso'][1],
'lang' => current( $translation['iso'] ),
);
// Remove installed language from available translations.
@ -942,7 +942,7 @@ function wp_dropdown_languages( $args = array() ) {
$structure[] = sprintf(
'<option value="%s" lang="%s"%s>%s</option>',
esc_attr( $translation['language'] ),
esc_attr( $translation['iso'][1] ),
esc_attr( current( $translation['iso'] ) ),
selected( $translation['language'], $args['selected'], false ),
esc_html( $translation['native_name'] )
);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31446';
$wp_version = '4.2-alpha-31447';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.