summaryrefslogtreecommitdiff
path: root/php/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/upload.php')
-rw-r--r--php/upload.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/php/upload.php b/php/upload.php
index 476120b..a189f87 100644
--- a/php/upload.php
+++ b/php/upload.php
@@ -80,6 +80,12 @@ function uploadFile($file)
throw new UploadException($file->error);
}
+ // Check if mime type is blocked
+ if (!in_array(mime_content_type($file), $FILTER_MIME)) {
+ throw new UploadException(UPLOAD_ERR_EXTENSION);
+ }
+
+
// Check if a file with the same hash and size (a file which is the same)
// does already exist in the database; if it does, return the proper link
// and data. PHP deletes the temporary file just uploaded automatically.