diff options
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r-- | phpBB/includes/functions_user.php | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c058cd2b9d..92cd42d521 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1038,10 +1038,15 @@ function avatar_upload($data, &$error) function avatar_gallery($category, &$error) { - global $config; + global $config, $phpbb_root_path, $user; $path = $phpbb_root_path . $config['avatar_gallery_path']; + if (!file_exists($path) || !is_dir($path)) + { + return array($user->lang['NONE'] => array()); + } + // To be replaced with SQL ... before M3 completion $dp = @opendir($path); @@ -1073,6 +1078,11 @@ function avatar_gallery($category, &$error) } closedir($dp); + if (!sizeof($data)) + { + return array($user->lang['NONE'] => array()); + } + @ksort($data); return $data; |