mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-13 13:16:36 +02:00
Merge branch 'prep-release-3.2.10' into prep-release-3.3.1
This commit is contained in:
@ -391,7 +391,7 @@ class bbcode_firstpass extends bbcode
|
||||
$in = str_replace(' ', '%20', $in);
|
||||
|
||||
// Checking urls
|
||||
if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
|
||||
if (!preg_match('#^' . get_preg_expression('url_http') . '$#iu', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
|
||||
{
|
||||
return '[img]' . $in . '[/img]';
|
||||
}
|
||||
@ -402,32 +402,6 @@ class bbcode_firstpass extends bbcode
|
||||
$in = 'http://' . $in;
|
||||
}
|
||||
|
||||
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
|
||||
{
|
||||
$imagesize = new \FastImageSize\FastImageSize();
|
||||
$size_info = $imagesize->getImageSize(htmlspecialchars_decode($in));
|
||||
|
||||
if ($size_info === false)
|
||||
{
|
||||
$error = true;
|
||||
$this->warn_msg[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $size_info['height'])
|
||||
{
|
||||
$error = true;
|
||||
$this->warn_msg[] = $user->lang('MAX_IMG_HEIGHT_EXCEEDED', (int) $config['max_' . $this->mode . '_img_height']);
|
||||
}
|
||||
|
||||
if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $size_info['width'])
|
||||
{
|
||||
$error = true;
|
||||
$this->warn_msg[] = $user->lang('MAX_IMG_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error || $this->path_in_domain($in))
|
||||
{
|
||||
return '[img]' . $in . '[/img]';
|
||||
|
Reference in New Issue
Block a user