From 53e65714a1ad1c0f127543ea757837249ff54bb9 Mon Sep 17 00:00:00 2001 From: Nikolay Bachiyski Date: Tue, 4 May 2010 21:55:34 +0000 Subject: [PATCH] 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 --- wp-includes/l10n.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/l10n.php b/wp-includes/l10n.php index 7a4ea8fcd8..4daff90f26 100644 --- a/wp-includes/l10n.php +++ b/wp-includes/l10n.php @@ -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'); }