diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-17 16:08:42 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-17 16:08:42 +0000 |
commit | 484d214ef71540b462fb72a0867cb56e61c2bb7f (patch) | |
tree | 7c6347ca643a14f860113a81eb48d9a33635477e /phpBB/includes | |
parent | cc42f6ed22ceb531db5ce25fdcf2140c7e5509f7 (diff) | |
download | forums-484d214ef71540b462fb72a0867cb56e61c2bb7f.tar forums-484d214ef71540b462fb72a0867cb56e61c2bb7f.tar.gz forums-484d214ef71540b462fb72a0867cb56e61c2bb7f.tar.bz2 forums-484d214ef71540b462fb72a0867cb56e61c2bb7f.tar.xz forums-484d214ef71540b462fb72a0867cb56e61c2bb7f.zip |
it has been decided amongst the team that using glob() is bad practice, after determining the overall usage among projects as well as the security history of the function.
git-svn-id: file:///svn/phpbb/trunk@7900 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions_module.php | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index ec7f7e230b..cb5536eb1d 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -127,30 +127,19 @@ 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); - if (!is_array($info_files)) - { - $dir = @opendir($user->lang_path . 'mods'); + $dir = @opendir($user->lang_path . 'mods'); - if ($dir) + if ($dir) + { + while (($entry = readdir($dir)) !== false) { - while (($entry = readdir($dir)) !== false) + if (strpos($entry, 'info_' . strtolower($this->p_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx) { - if (strpos($entry, 'info_' . strtolower($this->p_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx) - { - $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1)); - } + $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1)); } - closedir($dir); - } - } - else - { - foreach ($info_files as $file) - { - $add_files[] = 'mods/' . substr(basename($file), 0, -(strlen($phpEx) + 1)); } + closedir($dir); } if (sizeof($add_files)) |