summaryrefslogtreecommitdiffstats
path: root/application/service
diff options
context:
space:
mode:
Diffstat (limited to 'application/service')
-rw-r--r--application/service/files.php8
-rw-r--r--application/service/user.php1
2 files changed, 5 insertions, 4 deletions
diff --git a/application/service/files.php b/application/service/files.php
index 8d8b1d01a..c270500ef 100644
--- a/application/service/files.php
+++ b/application/service/files.php
@@ -89,6 +89,10 @@ class files {
$CI =& get_instance();
$errors = array();
+ if (empty($files)) {
+ throw new \exceptions\UserInputException("file/no-file", "No file was uploaded or unknown error occured.");
+ }
+
foreach ($files as $key => $file) {
$error_message = "";
@@ -113,7 +117,6 @@ class files {
} else {
$error_message = "Unknown error code: ".$file['error'].". Please report a bug.";
}
-
}
$filesize = filesize($file['tmp_name']);
@@ -127,9 +130,8 @@ class files {
"formfield" => $file["formfield"],
"message" => $error_message,
);
+ throw new \exceptions\FileUploadVerifyException("file/upload-verify", "Failed to verify uploaded file(s)", $errors);
}
}
-
- return $errors;
}
}
diff --git a/application/service/user.php b/application/service/user.php
index 97f2531f9..16fa62272 100644
--- a/application/service/user.php
+++ b/application/service/user.php
@@ -23,7 +23,6 @@ class user {
{
$CI =& get_instance();
-
$valid_levels = $CI->muser->get_access_levels();
if (array_search($access_level, $valid_levels) === false) {
throw new \exceptions\UserInputException("user/validation/access_level/invalid", "Invalid access levels requested.");