From: tokul Date: Wed, 3 Aug 2005 11:54:27 +0000 (+0000) Subject: glob exists only in 4.3.0+ X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6c8a387f4a5bf246eac097b8ad38c26e2c997e6e;p=squirrelmail.git glob exists only in 4.3.0+ git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9890 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/i18n.php b/functions/i18n.php index 8ff0dae4..5b33204d 100644 --- a/functions/i18n.php +++ b/functions/i18n.php @@ -682,16 +682,21 @@ $languages['en']['ALIAS'] = 'en_US'; * Solution for bug. 1240889. * setup.php file can contain $languages array entries and XTRA_CODE functions. */ -foreach(glob(SM_PATH.'locale/*') as $lang_dir) { - // remove trailing slash, if present - if (substr($lang_dir,-1)=='/') { - $lang_dir = substr($lang_dir,0,-1); - } - // load language setup - if (is_dir(SM_PATH.'locale/'.$lang_dir) && - file_exists(SM_PATH.'locale/'.$lang_dir.'/setup.php')) { - include_once(SM_PATH.'locale/'.$lang_dir.'/setup.php'); +if (is_dir(SM_PATH . 'locale') && + is_readable(SM_PATH . 'locale')) { + $localedir = dir(SM_PATH . 'locale'); + while($lang_dir=$localedir->read()) { + // remove trailing slash, if present + if (substr($lang_dir,-1)=='/') { + $lang_dir = substr($lang_dir,0,-1); + } + if ($lang_dir != '..' && $lang_dir != '.' && $lang_dir != 'CVS' && + is_dir(SM_PATH.'locale/'.$lang_dir) && + file_exists(SM_PATH.'locale/'.$lang_dir.'/setup.php')) { + include_once(SM_PATH.'locale/'.$lang_dir.'/setup.php'); + } } + $localedir->close(); } /* Detect whether gettext is installed. */