aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-10 17:36:59 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-10 17:36:59 +0000
commite5ae1698cac8f0eb222e23170cf3459bdff103c5 (patch)
tree3bcb69ffac15fc90433c75198c91bf1df58584fe /phpBB/includes/functions_module.php
parentd81f96877ffc873722e30298bbec96d5d26d9717 (diff)
downloadforums-e5ae1698cac8f0eb222e23170cf3459bdff103c5.tar
forums-e5ae1698cac8f0eb222e23170cf3459bdff103c5.tar.gz
forums-e5ae1698cac8f0eb222e23170cf3459bdff103c5.tar.bz2
forums-e5ae1698cac8f0eb222e23170cf3459bdff103c5.tar.xz
forums-e5ae1698cac8f0eb222e23170cf3459bdff103c5.zip
more failsafe "glob()" method.
git-svn-id: file:///svn/phpbb/trunk@7863 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 073dfa60ad..ec7f7e230b 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -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)
{