aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_user.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-05-27 00:37:15 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-05-27 00:37:15 +0000
commitb6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa (patch)
treec4143776c679666a5b7afe57f0dc02914ce287f0 /phpBB/includes/functions_user.php
parente1484f522d28194c63d424bc621b93d3cf8865b9 (diff)
downloadforums-b6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa.tar
forums-b6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa.tar.gz
forums-b6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa.tar.bz2
forums-b6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa.tar.xz
forums-b6a0ce82d413a55f95c3c7149e9d9bf47cf2f6aa.zip
Some cleanup ... fixes
git-svn-id: file:///svn/phpbb/trunk@4063 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_user.php')
-rw-r--r--phpBB/includes/functions_user.php23
1 files changed, 10 insertions, 13 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 93ac355d25..b5c128cf46 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -357,18 +357,9 @@ class ucp extends user
{
global $config, $db, $user;
- $avatar = explode(':', $user->data['user_avatar']);
- $avatar_type = array_shift($avatar);
-
- if ($avatar_type != 'upload')
- {
- return;
- }
-
- $avatar = implode('', $avatar);
- if (@file_exists('./' . $config['avatar_path'] . '/' . $avatar))
+ if (@file_exists('./' . $config['avatar_path'] . '/' . $user->data['user_avatar']))
{
- @unlink('./' . $config['avatar_path'] . '/' . $avatar);
+ @unlink('./' . $config['avatar_path'] . '/' . $user->data['user_avatar']);
}
}
@@ -387,11 +378,16 @@ class ucp extends user
return true;
}
- if (!($data['width'] || $data['height']) && ($config['avatar_max_width'] || $config['avatar_max_height']))
+ if ((!($data['width'] || $data['height']) || $data['remotelink'] != $user->data['user_avatar']) && ($config['avatar_max_width'] || $config['avatar_max_height']))
{
list($width, $height) = @getimagesize($data['remotelink']);
- if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
+ if (!$width || !$height)
+ {
+ $this->error[] = $user->lang['AVATAR_NO_SIZE'];
+ return true;
+ }
+ else if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
{
$this->error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_max_width'], $config['avatar_max_height']);
return true;
@@ -526,6 +522,7 @@ class ucp extends user
$filesize = filesize('./' . $config['avatar_path'] . '/' . $data['filename']);
if (!$filesize || $filesize > $config['avatar_filesize'])
{
+ @unlink('./' . $config['avatar_path'] . '/' . $data['filename']);
$this->error[] = sprintf($user->lang['AVATAR_WRONG_FILESIZE'], $config['avatar_filesize']);
return true;
}