aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php6
1 files changed, 3 insertions, 3 deletions
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",