mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-21 14:59:46 +02:00
[feature/avatars] Check if gravatar is within min/max width/height
PHPBB3-10018
This commit is contained in:
parent
b7b14f9a05
commit
9b61204a17
@ -132,6 +132,24 @@ class phpbb_avatar_driver_gravatar extends phpbb_avatar_driver
|
||||
$error[] = 'AVATAR_NO_SIZE';
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->config['avatar_max_width'] || $this->config['avatar_max_height'])
|
||||
{
|
||||
if ($row['avatar_width'] > $this->config['avatar_max_width'] || $row['avatar_height'] > $this->config['avatar_max_height'])
|
||||
{
|
||||
$error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->config['avatar_min_width'] || $this->config['avatar_min_height'])
|
||||
{
|
||||
if ($row['avatar_width'] < $this->config['avatar_min_width'] || $row['avatar_height'] < $this->config['avatar_min_height'])
|
||||
{
|
||||
$error[] = array('AVATAR_WRONG_SIZE', $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], $row['avatar_width'], $row['avatar_height']);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'avatar' => $row['avatar'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user