aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/textformatter
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/phpbb/textformatter
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/phpbb/textformatter')
-rw-r--r--phpBB/phpbb/textformatter/s9e/parser.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php
index 77328ee4d9..e46a0578d2 100644
--- a/phpBB/phpbb/textformatter/s9e/parser.php
+++ b/phpBB/phpbb/textformatter/s9e/parser.php
@@ -367,7 +367,6 @@ class parser implements \phpbb\textformatter\parser_interface
{
// Validate the URL
$url = BuiltInFilters::filterUrl($url, $url_config, $logger);
-
if ($url === false)
{
return false;
@@ -375,26 +374,23 @@ class parser implements \phpbb\textformatter\parser_interface
if ($max_height || $max_width)
{
- $stats = @getimagesize($url);
-
- if ($stats === false)
+ $imagesize = new \fastImageSize\fastImageSize();
+ $size_info = $imagesize->getImageSize($url);
+ if ($size_info === false)
{
$logger->err('UNABLE_GET_IMAGE_SIZE');
-
return false;
}
- if ($max_height && $max_height < $stats[1])
+ if ($max_height && $max_height < $size_info['height'])
{
$logger->err('MAX_IMG_HEIGHT_EXCEEDED', array('max_height' => $max_height));
-
return false;
}
- if ($max_width && $max_width < $stats[0])
+ if ($max_width && $max_width < $size_info['width'])
{
$logger->err('MAX_IMG_WIDTH_EXCEEDED', array('max_width' => $max_width));
-
return false;
}
}