aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.php
diff options
context:
space:
mode:
authorTristan Darricau <tristan.darricau@sensiolabs.com>2015-04-27 16:26:40 +0200
committerTristan Darricau <tristan.darricau@sensiolabs.com>2015-04-27 16:26:40 +0200
commit734b89e75cdb02ae436b03d3247cfa820e03f42c (patch)
tree8d348e342bce8db60211ec63deed795c7e5df64e /phpBB/includes/message_parser.php
parente7d297740117e644be18e2b9793471da5697c879 (diff)
parent9088f448633ff42d767afac674324d1e26911ab6 (diff)
downloadforums-734b89e75cdb02ae436b03d3247cfa820e03f42c.tar
forums-734b89e75cdb02ae436b03d3247cfa820e03f42c.tar.gz
forums-734b89e75cdb02ae436b03d3247cfa820e03f42c.tar.bz2
forums-734b89e75cdb02ae436b03d3247cfa820e03f42c.tar.xz
forums-734b89e75cdb02ae436b03d3247cfa820e03f42c.zip
Merge pull request #3524 from marc1706/ticket/8672
[ticket/8672] Add class for retrieving imagesize without download
Diffstat (limited to 'phpBB/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 3027566f43..9fe598d7fb 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -339,22 +339,23 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{
- $stats = @getimagesize(htmlspecialchars_decode($in));
+ $imagesize = new \fastImageSize\fastImageSize();
+ $size_info = $imagesize->getImageSize(htmlspecialchars_decode($in));
- if ($stats === false)
+ 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'] < $stats[1])
+ 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'] < $stats[0])
+ 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']);