X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..6359b807ff8b4ffa151d8756cdefb861c6c1d4db:/wp-includes/l10n.php diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 4c5d8b19..339602b1 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -763,11 +763,15 @@ function translate_user_role( $name ) { function get_available_languages( $dir = null ) { $languages = array(); - foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) { - $lang_file = basename($lang_file, '.mo'); - if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) && - 0 !== strpos( $lang_file, 'admin-' )) - $languages[] = $lang_file; + $lang_files = glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ); + if ( $lang_files ) { + foreach( $lang_files as $lang_file ) { + $lang_file = basename( $lang_file, '.mo' ); + if ( 0 !== strpos( $lang_file, 'continents-cities' ) && 0 !== strpos( $lang_file, 'ms-' ) && + 0 !== strpos( $lang_file, 'admin-' ) ) { + $languages[] = $lang_file; + } + } } return $languages;