From e5ae1698cac8f0eb222e23170cf3459bdff103c5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 10 Jul 2007 17:36:59 +0000 Subject: more failsafe "glob()" method. git-svn-id: file:///svn/phpbb/trunk@7863 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/style.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'phpBB/style.php') 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)) { -- cgit v1.2.1