aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/photos/image/ajax_upload.php2
-rw-r--r--classes/TidypicsImage.php5
-rw-r--r--languages/en.php1
3 files changed, 7 insertions, 1 deletions
diff --git a/actions/photos/image/ajax_upload.php b/actions/photos/image/ajax_upload.php
index d6b083cf6..daa824c42 100644
--- a/actions/photos/image/ajax_upload.php
+++ b/actions/photos/image/ajax_upload.php
@@ -22,7 +22,7 @@ if (empty($_FILES)) {
exit;
}
-$file = $_FILES['Image'];
+$file = $_FILES[$file_var_name];
$mime = tp_upload_get_mimetype($file['name']);
if ($mime == 'unknown') {
diff --git a/classes/TidypicsImage.php b/classes/TidypicsImage.php
index c0b5de723..dd4324468 100644
--- a/classes/TidypicsImage.php
+++ b/classes/TidypicsImage.php
@@ -244,6 +244,11 @@ class TidypicsImage extends ElggFile {
trigger_error('Tidypics warning: image memory size too large for resizing so rejecting', E_USER_WARNING);
throw new Exception(elgg_echo('tidypics:image_pixels'));
}
+
+ // make sure file fits quota
+ if (!tp_upload_check_quota($data['size'], elgg_get_logged_in_user_guid())) {
+ throw new Exception(elgg_echo('tidypics:cannot_upload_exceeds_quota'));
+ }
}
/**
diff --git a/languages/en.php b/languages/en.php
index 0d6ea2db8..b765508a6 100644
--- a/languages/en.php
+++ b/languages/en.php
@@ -274,6 +274,7 @@ The photo can be viewed here: %s",
'image:downloadfailed' => "Sorry; this image is not available.",
'tidypics:nosettings' => "Admin of this site has not set photo album settings.",
'tidypics:exceed_quota' => "You have exceeded the quota set by the administrator",
+ 'tidypics:cannot_upload_exceeds_quota' => 'Image not uploaded. File size exceeds available quota.',
'images:notedited' => "Not all images were successfully updated",
'album:none' => "No albums have been created yet.",
'album:uploadfailed' => "Sorry; we could not save your album.",