From 20c87044b938204a75a8f2a28b5dea3d4e686eb3 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 16 Nov 2024 15:09:38 -0500 Subject: [PATCH] Only accept jpg, jpeg and png for company logo --- admin_settings_company.php | 2 +- post/admin/admin_settings_company.php | 3 +-- setup.php | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/admin_settings_company.php b/admin_settings_company.php index f3e42cf6..797ba20e 100644 --- a/admin_settings_company.php +++ b/admin_settings_company.php @@ -48,7 +48,7 @@ $company_initials = nullable_htmlentities(initials($company_name));
- +
diff --git a/post/admin/admin_settings_company.php b/post/admin/admin_settings_company.php index 6ec33b45..7b4cf647 100644 --- a/post/admin/admin_settings_company.php +++ b/post/admin/admin_settings_company.php @@ -20,10 +20,9 @@ if (isset($_POST['edit_company'])) { // Check to see if a file is attached if ($_FILES['file']['tmp_name'] != '') { - if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'gif', 'png'))) { + if ($new_file_name = checkFileUpload($_FILES['file'], array('jpg', 'jpeg', 'png'))) { $file_tmp_path = $_FILES['file']['tmp_name']; - // directory in which the uploaded file will be moved $upload_file_dir = "uploads/settings/"; $dest_path = $upload_file_dir . $new_file_name; diff --git a/setup.php b/setup.php index 92528e6e..d168eac1 100644 --- a/setup.php +++ b/setup.php @@ -216,7 +216,7 @@ if (isset($_POST['add_company_settings'])) { $new_file_name = md5(time() . $file_name) . '.' . $file_extension; // check if file has one of the following extensions - $allowed_file_extensions = array('jpg', 'gif', 'png'); + $allowed_file_extensions = array('jpg', 'jpeg', 'png'); if (in_array($file_extension,$allowed_file_extensions) === false) { $file_error = 1; @@ -975,7 +975,7 @@ if (isset($_POST['add_telemetry'])) {
- +