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:
parent
0ad32e0c61
commit
8ff9331f75
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue