Cast the result of glob(), because on some systems it returns false on empty result set. Props ipstenu, fixes #13252

git-svn-id: https://develop.svn.wordpress.org/trunk@14456 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Nikolay Bachiyski 2010-05-04 21:55:34 +00:00
parent 8d6694a68d
commit 53e65714a1
1 changed files with 1 additions and 1 deletions

View File

@ -493,7 +493,7 @@ function translate_user_role( $name ) {
function get_available_languages( $dir = null ) {
$languages = array();
foreach( glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
foreach( (array)glob( ( is_null( $dir) ? WP_LANG_DIR : $dir ) . '/*.mo' ) as $lang_file ) {
if ( false === strpos( $lang_file, 'continents-cities' ) ) {
$languages[] = basename($lang_file, '.mo');
}