From fe9590cf5a3946260d61748cfc2ac0e13f10c23b Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 28 Mar 2006 16:46:49 +0000 Subject: [PATCH] - Bug 1301 git-svn-id: file:///svn/phpbb/trunk@5743 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 4 ++-- phpBB/includes/acp/acp_attachments.php | 2 +- phpBB/includes/acp/acp_icons.php | 2 +- phpBB/includes/acp/acp_language.php | 2 +- phpBB/includes/acp/acp_main.php | 2 +- phpBB/includes/acp/acp_modules.php | 2 +- phpBB/includes/acp/acp_styles.php | 6 +++--- phpBB/includes/functions_user.php | 6 +++--- phpBB/install/index.php | 4 ++-- phpBB/install/install.php | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index c5162a36d3..42db254567 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -73,7 +73,7 @@ class acm global $phpEx; $dir = opendir($this->cache_dir); - while ($entry = readdir($dir)) + while (($entry = readdir($dir)) !== false) { if (!preg_match('/^(sql_|data_(?!global))/', $entry)) { @@ -159,7 +159,7 @@ class acm $regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')'; $dir = opendir($this->cache_dir); - while ($entry = readdir($dir)) + while (($entry = readdir($dir)) !== false) { if (strpos($entry, 'sql_') !== 0) { diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index f2faa26d02..0dccf96101 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -864,7 +864,7 @@ class acp_attachments $attach_filelist = array(); $dir = @opendir($phpbb_root_path . $config['upload_path']); - while ($file = @readdir($dir)) + while (($file = @readdir($dir)) !== false) { if (is_file($phpbb_root_path . $config['upload_path'] . '/' . $file) && filesize($phpbb_root_path . $config['upload_path'] . '/' . $file) && $file{0} != '.' && $file != 'index.htm' && !preg_match('#^thumb\_#', $file)) { diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 247a97e558..3ca135847d 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -79,7 +79,7 @@ class acp_icons unset($imglist); $dir = @opendir($phpbb_root_path . $img_path); - while ($file = @readdir($dir)) + while (($file = @readdir($dir)) !== false) { if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file)) { diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 83abcacc67..19ac78b301 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -875,7 +875,7 @@ class acp_language $new_ary = $iso = array(); $dp = opendir("{$phpbb_root_path}language"); - while ($file = readdir($dp)) + while (($file = readdir($dp)) !== false) { if ($file{0} != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt")) { diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index bf77ccba6b..8a7bf5ff75 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -287,7 +287,7 @@ class acp_main if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) { - while ($file = readdir($avatar_dir)) + while (($file = readdir($avatar_dir)) !== false) { if ($file{0} != '.') { diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 8cd9d871a2..481b6f066c 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -575,7 +575,7 @@ class acp_modules if (!$module) { $dh = opendir($directory); - while ($file = readdir($dh)) + while (($file = readdir($dh)) !== false) { // Is module? if (preg_match('/^' . $this->module_class . '_.+\.' . $phpEx . '$/', $file)) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 20dbabef0d..0a3529f3f5 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -376,7 +376,7 @@ pagination_sep = \'{PAGINATION_SEP}\' * @todo grab templates/themes/imagesets from style directories */ $dp = opendir("{$phpbb_root_path}styles"); - while ($file = readdir($dp)) + while (($file = readdir($dp)) !== false) { $subpath = ($mode != 'style') ? "$mode/" : ''; if ($file{0} != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) @@ -532,12 +532,12 @@ pagination_sep = \'{PAGINATION_SEP}\' $dir = "{$phpbb_root_path}styles/$imageset_path/imageset"; $dp = opendir($dir); - while ($file = readdir($dp)) + while (($file = readdir($dp)) !== false) { if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file{0} != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang'])) { $dp2 = opendir("$dir/$file"); - while ($file2 = readdir($dp2)) + while (($file2 = readdir($dp2)) !== false) { $imglang = $file; if (preg_match('#\.(?:gif|jpg|png)$#', $file2)) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c34f16c1e0..bb52d36471 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1058,16 +1058,16 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var // Collect images $dp = @opendir($path); - while ($file = readdir($dp)) + while (($file = readdir($dp)) !== false) { if ($file{0} != '.' && is_dir("$path/$file")) { $avatar_row_count = $avatar_col_count = 0; $dp2 = @opendir("$path/$file"); - while ($sub_file = readdir($dp2)) + while (($sub_file = readdir($dp2)) !== false) { - if (preg_match('#\.(gif$|png$|jpg|jpeg)$#i', $sub_file)) + if (preg_match('#\.(?:gif|png|jpe?g)$#i', $sub_file)) { $avatar_list[$file][$avatar_row_count][$avatar_col_count] = array( 'file' => "$file/$sub_file", diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 421631b149..409b7e2e6b 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -103,7 +103,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $language == '') if ($language == '') { $dir = @opendir($phpbb_root_path . 'language'); - while ($file = readdir($dir)) + while (($file = readdir($dir)) !== false) { $path = $phpbb_root_path . 'language/' . $file; @@ -168,7 +168,7 @@ class module $dir = @opendir('.'); $setmodules = 1; - while ($file = readdir($dir)) + while (($file = readdir($dir)) !== false) { if (preg_match('#^install_(.*?)\.' . $phpEx . '$#', $file)) { diff --git a/phpBB/install/install.php b/phpBB/install/install.php index eb02a0ec6b..bf8651f62f 100644 --- a/phpBB/install/install.php +++ b/phpBB/install/install.php @@ -184,7 +184,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language) if (!$language) { $dir = @opendir($phpbb_root_path . 'language'); - while ($file = readdir($dir)) + while (($file = readdir($dir)) !== false) { $path = $phpbb_root_path . 'language/' . $file;