summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/api/v1/file.php5
-rw-r--r--application/controllers/file.php14
2 files changed, 2 insertions, 17 deletions
diff --git a/application/controllers/api/v1/file.php b/application/controllers/api/v1/file.php
index c291ae879..82060e420 100644
--- a/application/controllers/api/v1/file.php
+++ b/application/controllers/api/v1/file.php
@@ -27,10 +27,7 @@ class file extends \controllers\api\api_controller {
throw new \exceptions\PublicApiException("file/no-file", "No file was uploaded or unknown error occured.");
}
- $errors = \service\files::verify_uploaded_files($files);
- if (!empty($errors)) {
- throw new \exceptions\PublicApiException("file/upload-verify-failed", "Failed to verify uploaded file", $errors);
- }
+ \service\files::verify_uploaded_files($files);
$limits = $this->muser->get_upload_id_limits();
$urls = array();
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 5fce8afc8..e35978a1e 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -897,19 +897,7 @@ class File extends MY_Controller {
$files = getNormalizedFILES();
- if (empty($files)) {
- show_error("No file was uploaded or unknown error occured.");
- }
-
- $errors = service\files::verify_uploaded_files($files);
- if (!empty($errors)) {
- $messages = array();
- foreach ($errors as $error) {
- $messages[] = htmlspecialchars($error["filename"]).": ".$error["message"];
- }
- show_error("Error(s) occured while uploading:<br>".implode("<br>", $messages), 400);
- }
-
+ service\files::verify_uploaded_files($files);
$limits = $this->muser->get_upload_id_limits();
foreach ($files as $key => $file) {