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/install/install_update.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'phpBB/install/install_update.php') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 2140e557e4..9bf475abfa 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -433,8 +433,27 @@ 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); - foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) + if ($file_list === false || $file_list === NULL) + { + $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