diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-10 17:36:59 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-07-10 17:36:59 +0000 |
commit | e5ae1698cac8f0eb222e23170cf3459bdff103c5 (patch) | |
tree | 3bcb69ffac15fc90433c75198c91bf1df58584fe /phpBB/style.php | |
parent | d81f96877ffc873722e30298bbec96d5d26d9717 (diff) | |
download | forums-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/style.php')
-rw-r--r-- | phpBB/style.php | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/phpBB/style.php b/phpBB/style.php index 58eabd0e7f..f49acc44d3 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -141,8 +141,27 @@ 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); - foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) + if (!is_array($file_list)) + { + $file_list = array(); + $dir = @opendir("{$phpbb_root_path}styles/{$theme['theme_path']}/theme"); + + if ($dir) + { + while (($entry = readdir($dir)) !== false) + { + if (substr(strrchr($entry, '.'), 1) == 'css') + { + $file_list[] = $entry; + } + } + closedir($dir); + } + } + + foreach ($file_list as $file) { if ($last_change < @filemtime($file)) { |