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
This commit is contained in:
nbachiyski 2010-05-04 21:55:34 +00:00
parent 0ad32e0c61
commit 8ff9331f75

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');
}