From 4fdd5ae76910fc40fd7213470d998ba3c27fa41d Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 4 Mar 2025 00:13:21 -0500 Subject: [PATCH] Fix Bug adding software license if no vendor is selected --- post/user/software.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/post/user/software.php b/post/user/software.php index 1d5f8290..58177a8e 100644 --- a/post/user/software.php +++ b/post/user/software.php @@ -66,7 +66,7 @@ if (isset($_POST['add_software'])) { $expire = "'" . $expire . "'"; } $notes = sanitizeInput($_POST['notes']); - $vendor = sanitizeInput($_POST['vendor'] ?? 0); + $vendor = intval($_POST['vendor'] ?? 0); mysqli_query($mysqli,"INSERT INTO software SET software_name = '$name', software_version = '$version', software_description = '$description', software_type = '$type', software_key = '$key', software_license_type = '$license_type', software_seats = $seats, software_purchase_reference = '$purchase_reference', software_purchase = $purchase, software_expire = $expire, software_notes = '$notes', software_vendor_id = $vendor, software_client_id = $client_id"); @@ -127,7 +127,7 @@ if (isset($_POST['edit_software'])) { $expire = "'" . $expire . "'"; } $notes = sanitizeInput($_POST['notes']); - $vendor = sanitizeInput($_POST['vendor'] ?? 0); + $vendor = intval($_POST['vendor'] ?? 0); mysqli_query($mysqli,"UPDATE software SET software_name = '$name', software_version = '$version', software_description = '$description', software_type = '$type', software_key = '$key', software_license_type = '$license_type', software_seats = $seats, software_purchase_reference = '$purchase_reference', software_purchase = $purchase, software_expire = $expire, software_notes = '$notes', software_vendor_id = $vendor WHERE software_id = $software_id");