aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions_module.php25
-rw-r--r--phpBB/install/install_update.php28
-rw-r--r--phpBB/style.php28
3 files changed, 21 insertions, 60 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))
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 0659e1f364..7b0e405a0f 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -441,33 +441,19 @@ class install_update extends module
else if (!$recache)
{
$last_change = $theme['theme_mtime'];
- $file_list = @glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT);
+ $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
- if ($file_list === false || $file_list === NULL)
+ if ($dir)
{
- $file_list = array();
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
-
- if ($dir)
+ while (($entry = readdir($dir)) !== false)
{
- while (($entry = readdir($dir)) !== false)
+ if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
{
- if (substr(strrchr($entry, '.'), 1) == 'css')
- {
- $file_list[] = "{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}";
- }
+ $recache = true;
+ break;
}
- closedir($dir);
- }
- }
-
- foreach ($file_list as $file)
- {
- if ($last_change < @filemtime($file))
- {
- $recache = true;
- break;
}
+ closedir($dir);
}
}
diff --git a/phpBB/style.php b/phpBB/style.php
index d6bb5bd9da..36fea2d554 100644
--- a/phpBB/style.php
+++ b/phpBB/style.php
@@ -141,33 +141,19 @@ if ($id && $sid)
else if (!$recache)
{
$last_change = $theme['theme_mtime'];
- $file_list = @glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT);
+ $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
- if (!is_array($file_list))
+ if ($dir)
{
- $file_list = array();
- $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme");
-
- if ($dir)
+ while (($entry = readdir($dir)) !== false)
{
- while (($entry = readdir($dir)) !== false)
+ if (substr(strrchr($entry, '.'), 1) == 'css' && $last_change < @filemtime("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}"))
{
- if (substr(strrchr($entry, '.'), 1) == 'css')
- {
- $file_list[] = "{$phpbb_root_path}styles/{$theme['theme_path']}/theme/{$entry}";
- }
+ $recache = true;
+ break;
}
- closedir($dir);
- }
- }
-
- foreach ($file_list as $file)
- {
- if ($last_change < @filemtime($file))
- {
- $recache = true;
- break;
}
+ closedir($dir);
}
}