From c57233414f305bdd9de5f0dfc55be12b89ec11ac Mon Sep 17 00:00:00 2001 From: Yury Pikhtarev Date: Wed, 20 Dec 2023 22:49:00 +0400 Subject: [PATCH] Apply fixes from StyleCI (#1242) Co-authored-by: StyleCI Bot --- src/Legacy/Attach.php | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php index 0b0782d1b..9e1d928c5 100644 --- a/src/Legacy/Attach.php +++ b/src/Legacy/Attach.php @@ -734,22 +734,25 @@ class Attach $file = $_FILES['fileupload']['tmp_name']; $this->type = $_FILES['fileupload']['type']; - if (isset($_FILES['fileupload']['error'])) { - switch($_FILES['fileupload']['error']) { - case UPLOAD_ERR_NO_FILE: - bb_die('No file content sent'); - case UPLOAD_ERR_INI_SIZE: - bb_die('upload_max_filesize setting: ' . ini_get('upload_max_filesize')); - case UPLOAD_ERR_CANT_WRITE: - bb_die('Failed to write file to disk, check permissions'); - case UPLOAD_ERR_PARTIAL: - bb_die('The uploaded file was only partially uploaded'); + if (isset($_FILES['fileupload']['error'])) { + switch($_FILES['fileupload']['error']) { + case UPLOAD_ERR_NO_FILE: + bb_die('No file content sent'); + // no break + case UPLOAD_ERR_INI_SIZE: + bb_die('upload_max_filesize setting: ' . ini_get('upload_max_filesize')); + // no break + case UPLOAD_ERR_CANT_WRITE: + bb_die('Failed to write file to disk, check permissions'); + // no break + case UPLOAD_ERR_PARTIAL: + bb_die('The uploaded file was only partially uploaded'); + } } - } - if (isset($_FILES['fileupload']['size']) && $_FILES['fileupload']['size'] === 0) { - bb_die('Tried to upload empty file'); - } + if (isset($_FILES['fileupload']['size']) && $_FILES['fileupload']['size'] === 0) { + bb_die('Tried to upload empty file'); + } $this->type = strtolower($this->type); $this->extension = strtolower(get_extension($this->filename));