aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/mod/photos.php b/mod/photos.php
index e1926bb56..addc04d76 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -453,6 +453,14 @@ function photos_post(&$a) {
$filename = basename($_FILES['userfile']['name']);
$filesize = intval($_FILES['userfile']['size']);
+ $maximagesize = get_config('system','maximagesize');
+
+ if(($maximagesize) && ($filesize > $maximagesize)) {
+ notice( t('Image exceeds size limit of ') . $maximagesize . EOL);
+ @unlink($src);
+ return;
+ }
+
$imagedata = @file_get_contents($src);
$ph = new Photo($imagedata);