summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-01-22 23:02:38 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2015-01-22 23:02:38 +0100
commit5776bfec059f4fd32977e9ddbf97ca4d652dab7a (patch)
treea1aa3536f7dee9e28d9b0ccce244b8b7ff3f8e97 /lib
parentcb8440c55aee83f7a1359ad1a53e7255c06eb527 (diff)
parent3af8bde949ee14360574ec504be80a01ccd466ea (diff)
downloadnextcloud-server-5776bfec059f4fd32977e9ddbf97ca4d652dab7a.tar.gz
nextcloud-server-5776bfec059f4fd32977e9ddbf97ca4d652dab7a.zip
Merge pull request #13449 from owncloud/image_preview_limit
add config-option for an image's maximum filesize when generating previews
Diffstat (limited to 'lib')
-rw-r--r--lib/private/preview/image.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/private/preview/image.php b/lib/private/preview/image.php
index 986a44b48fd..e8473ebb8a4 100644
--- a/lib/private/preview/image.php
+++ b/lib/private/preview/image.php
@@ -26,6 +26,13 @@ class Image extends Provider {
return false;
}
+ $maxSizeForImages = \OC::$server->getConfig()->getSystemValue('preview_max_filesize_image', 50);
+ $size = $fileInfo->getSize();
+
+ if ($maxSizeForImages !== -1 && $size > ($maxSizeForImages * 1024 * 1024)) {
+ return false;
+ }
+
$image = new \OC_Image();
if($fileInfo['encrypted'] === true) {