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/style.php | |
| 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/style.php')
| -rw-r--r-- | phpBB/style.php | 28 |
1 files changed, 7 insertions, 21 deletions
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); } } |
