1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 23:55:26 +02:00

- Bug 1301

git-svn-id: file:///svn/phpbb/trunk@5743 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
David M 2006-03-28 16:46:49 +00:00
parent 20e6dbb389
commit fe9590cf5a
10 changed files with 16 additions and 16 deletions

View File

@ -73,7 +73,7 @@ class acm
global $phpEx; global $phpEx;
$dir = opendir($this->cache_dir); $dir = opendir($this->cache_dir);
while ($entry = readdir($dir)) while (($entry = readdir($dir)) !== false)
{ {
if (!preg_match('/^(sql_|data_(?!global))/', $entry)) if (!preg_match('/^(sql_|data_(?!global))/', $entry))
{ {
@ -159,7 +159,7 @@ class acm
$regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')'; $regex = '(' . ((is_array($table)) ? implode('|', $table) : $table) . ')';
$dir = opendir($this->cache_dir); $dir = opendir($this->cache_dir);
while ($entry = readdir($dir)) while (($entry = readdir($dir)) !== false)
{ {
if (strpos($entry, 'sql_') !== 0) if (strpos($entry, 'sql_') !== 0)
{ {

View File

@ -864,7 +864,7 @@ class acp_attachments
$attach_filelist = array(); $attach_filelist = array();
$dir = @opendir($phpbb_root_path . $config['upload_path']); $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)) 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))
{ {

View File

@ -79,7 +79,7 @@ class acp_icons
unset($imglist); unset($imglist);
$dir = @opendir($phpbb_root_path . $img_path); $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)) if (is_file($phpbb_root_path . $img_path . '/' . $file) && preg_match('#\.pak$#i', $file))
{ {

View File

@ -875,7 +875,7 @@ class acp_language
$new_ary = $iso = array(); $new_ary = $iso = array();
$dp = opendir("{$phpbb_root_path}language"); $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")) if ($file{0} != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
{ {

View File

@ -287,7 +287,7 @@ class acp_main
if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path']))
{ {
while ($file = readdir($avatar_dir)) while (($file = readdir($avatar_dir)) !== false)
{ {
if ($file{0} != '.') if ($file{0} != '.')
{ {

View File

@ -575,7 +575,7 @@ class acp_modules
if (!$module) if (!$module)
{ {
$dh = opendir($directory); $dh = opendir($directory);
while ($file = readdir($dh)) while (($file = readdir($dh)) !== false)
{ {
// Is module? // Is module?
if (preg_match('/^' . $this->module_class . '_.+\.' . $phpEx . '$/', $file)) if (preg_match('/^' . $this->module_class . '_.+\.' . $phpEx . '$/', $file))

View File

@ -376,7 +376,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
* @todo grab templates/themes/imagesets from style directories * @todo grab templates/themes/imagesets from style directories
*/ */
$dp = opendir("{$phpbb_root_path}styles"); $dp = opendir("{$phpbb_root_path}styles");
while ($file = readdir($dp)) while (($file = readdir($dp)) !== false)
{ {
$subpath = ($mode != 'style') ? "$mode/" : ''; $subpath = ($mode != 'style') ? "$mode/" : '';
if ($file{0} != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) 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"; $dir = "{$phpbb_root_path}styles/$imageset_path/imageset";
$dp = opendir($dir); $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'])) if (!is_file($dir . '/' . $file) && !is_link($dir . '/' . $file) && $file{0} != '.' && strtoupper($file) != 'CVS' && !sizeof($imagesetlist['lang']))
{ {
$dp2 = opendir("$dir/$file"); $dp2 = opendir("$dir/$file");
while ($file2 = readdir($dp2)) while (($file2 = readdir($dp2)) !== false)
{ {
$imglang = $file; $imglang = $file;
if (preg_match('#\.(?:gif|jpg|png)$#', $file2)) if (preg_match('#\.(?:gif|jpg|png)$#', $file2))

View File

@ -1058,16 +1058,16 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var
// Collect images // Collect images
$dp = @opendir($path); $dp = @opendir($path);
while ($file = readdir($dp)) while (($file = readdir($dp)) !== false)
{ {
if ($file{0} != '.' && is_dir("$path/$file")) if ($file{0} != '.' && is_dir("$path/$file"))
{ {
$avatar_row_count = $avatar_col_count = 0; $avatar_row_count = $avatar_col_count = 0;
$dp2 = @opendir("$path/$file"); $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( $avatar_list[$file][$avatar_row_count][$avatar_col_count] = array(
'file' => "$file/$sub_file", 'file' => "$file/$sub_file",

View File

@ -103,7 +103,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && $language == '')
if ($language == '') if ($language == '')
{ {
$dir = @opendir($phpbb_root_path . 'language'); $dir = @opendir($phpbb_root_path . 'language');
while ($file = readdir($dir)) while (($file = readdir($dir)) !== false)
{ {
$path = $phpbb_root_path . 'language/' . $file; $path = $phpbb_root_path . 'language/' . $file;
@ -168,7 +168,7 @@ class module
$dir = @opendir('.'); $dir = @opendir('.');
$setmodules = 1; $setmodules = 1;
while ($file = readdir($dir)) while (($file = readdir($dir)) !== false)
{ {
if (preg_match('#^install_(.*?)\.' . $phpEx . '$#', $file)) if (preg_match('#^install_(.*?)\.' . $phpEx . '$#', $file))
{ {

View File

@ -184,7 +184,7 @@ if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) && !$language)
if (!$language) if (!$language)
{ {
$dir = @opendir($phpbb_root_path . 'language'); $dir = @opendir($phpbb_root_path . 'language');
while ($file = readdir($dir)) while (($file = readdir($dir)) !== false)
{ {
$path = $phpbb_root_path . 'language/' . $file; $path = $phpbb_root_path . 'language/' . $file;