aboutsummaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/ajax_upload.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/actions/ajax_upload.php b/actions/ajax_upload.php
index 9aea9c19d..1f5588197 100644
--- a/actions/ajax_upload.php
+++ b/actions/ajax_upload.php
@@ -16,6 +16,7 @@ if (!$album) {
// probably POST limit exceeded
if (empty($_FILES)) {
+ echo 'Image was too large';
exit;
}
@@ -28,9 +29,15 @@ $temp_file = $_FILES['Image']['tmp_name'];
$name = $_FILES['Image']['name'];
$file_size = $_FILES['Image']['size'];
+$mime = tp_upload_get_mimetype($name);
+if ($mime == 'unknown') {
+ echo 'Not an image';
+ exit;
+}
+
$image = new TidypicsImage();
$image->container_guid = $album_guid;
-$image->setMimeType(tp_upload_get_mimetype($name));
+$image->setMimeType($mime);
$image->simpletype = "image";
$image->access_id = $album->access_id;
$image->title = substr($name, 0, strrpos($name, '.'));
@@ -50,5 +57,5 @@ if (get_plugin_setting('img_river_view', 'tidypics') === "all") {
add_to_river('river/object/image/create', 'create', $image->owner_guid, $image->guid);
}
-echo "1";
+echo "success";
exit; \ No newline at end of file