From: Brion Vibber Date: Wed, 8 Aug 2007 23:08:54 +0000 (+0000) Subject: * glob() is horribly unreliable and doesn't work on some systems, including X-Git-Tag: 1.31.0-rc.0~51819 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=f4f7d2f07c096fb098023875b7d75bce71963ee9;p=lhc%2Fweb%2Fwiklou.git * glob() is horribly unreliable and doesn't work on some systems, including free.fr shared hosting. No longer using it in Language::getLanguageNames() --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index bbccd3b21c..b90e13b3ff 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -369,6 +369,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * Fix comments in contributions and log pages for RTL languages * Make installer include_path-independent, so it should work on hosts which disable user setting of PHP include_path setting +* glob() is horribly unreliable and doesn't work on some systems, including + free.fr shared hosting. No longer using it in Language::getLanguageNames() == API changes since 1.10 == diff --git a/languages/Language.php b/languages/Language.php index 1da78d3ab2..6862fd4931 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -338,9 +338,9 @@ class Language { } global $IP; - $messageFiles = glob( "$IP/languages/messages/Messages*.php" ); $names = array(); - foreach ( $messageFiles as $file ) { + $dir = opendir( "$IP/languages/messages" ); + while( false !== ( $file = readdir( $dir ) ) ) { $m = array(); if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $file, $m ) ) { $code = str_replace( '_', '-', strtolower( $m[1] ) ); @@ -349,6 +349,7 @@ class Language { } } } + closedir( $dir ); return $names; }