From f4f7d2f07c096fb098023875b7d75bce71963ee9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 8 Aug 2007 23:08:54 +0000 Subject: [PATCH] * glob() is horribly unreliable and doesn't work on some systems, including free.fr shared hosting. No longer using it in Language::getLanguageNames() --- RELEASE-NOTES | 2 ++ languages/Language.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.20.1