1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

more failsafe "glob()" method.

git-svn-id: file:///svn/phpbb/trunk@7863 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-07-10 17:36:59 +00:00
parent d81f96877f
commit e5ae1698ca
5 changed files with 67 additions and 8 deletions

View File

@@ -127,9 +127,25 @@ class p_master
if (file_exists($user->lang_path . 'mods'))
{
$add_files = array();
$info_files = glob($user->lang_path . 'mods/info_' . strtolower($this->p_class) . '_*.' . $phpEx, GLOB_NOSORT);
$info_files = @glob($user->lang_path . 'mods/info_' . strtolower($this->p_class) . '_*.' . $phpEx, GLOB_NOSORT);
if ($info_files !== false && sizeof($info_files))
if (!is_array($info_files))
{
$dir = @opendir($user->lang_path . 'mods');
if ($dir)
{
while (($entry = readdir($dir)) !== false)
{
if (strpos($entry, 'info_' . strtolower($this->p_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
{
$add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
}
}
closedir($dir);
}
}
else
{
foreach ($info_files as $file)
{