mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
(hopefully) fixed the error display for uploading avatars (if avatar is too big)
git-svn-id: file:///svn/phpbb/trunk@5749 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
1aed382e52
commit
ceb03a3804
2 changed files with 4 additions and 3 deletions
|
@ -278,7 +278,7 @@ class filespec
|
||||||
|
|
||||||
if (!$this->upload->valid_dimensions($this))
|
if (!$this->upload->valid_dimensions($this))
|
||||||
{
|
{
|
||||||
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->min_width, $this->min_height, $this->max_width, $this->max_height);
|
$this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_SIZE'], $this->upload->min_width, $this->upload->min_height, $this->upload->max_width, $this->upload->max_height);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -532,6 +532,7 @@ class fileupload
|
||||||
$url['path'] = explode('.', $url['path']);
|
$url['path'] = explode('.', $url['path']);
|
||||||
$ext = array_pop($url['path']);
|
$ext = array_pop($url['path']);
|
||||||
|
|
||||||
|
$url['path'] = implode('', $url['path']);
|
||||||
$upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : '');
|
$upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : '');
|
||||||
$filename = $url['path'];
|
$filename = $url['path'];
|
||||||
$filesize = 0;
|
$filesize = 0;
|
||||||
|
|
|
@ -992,13 +992,13 @@ function avatar_remote($data, &$error)
|
||||||
}
|
}
|
||||||
else if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
|
else if ($width > $config['avatar_max_width'] || $height > $config['avatar_max_height'])
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_max_width'], $config['avatar_max_height']);
|
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height'])
|
else if ($data['width'] > $config['avatar_max_width'] || $data['height'] > $config['avatar_max_height'])
|
||||||
{
|
{
|
||||||
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_max_width'], $config['avatar_max_height']);
|
$error[] = sprintf($user->lang['AVATAR_WRONG_SIZE'], $config['avatar_min_width'], $config['avatar_min_height'], $config['avatar_max_width'], $config['avatar_max_height']);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue