From 8ff9331f7571ee98d300ecbc9a60d4f6e03f2a10 Mon Sep 17 00:00:00 2001 From: nbachiyski 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: http://svn.automattic.com/wordpress/trunk@14456 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 7a4ea8fcd..4daff90f2 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'); }