Skip to content

Commit 4fdd5ae

Browse files
committed
Fix Bug adding software license if no vendor is selected
1 parent 2c074e9 commit 4fdd5ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

post/user/software.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
$expire = "'" . $expire . "'";
6767
}
6868
$notes = sanitizeInput($_POST['notes']);
69-
$vendor = sanitizeInput($_POST['vendor'] ?? 0);
69+
$vendor = intval($_POST['vendor'] ?? 0);
7070

7171
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");
7272

@@ -127,7 +127,7 @@
127127
$expire = "'" . $expire . "'";
128128
}
129129
$notes = sanitizeInput($_POST['notes']);
130-
$vendor = sanitizeInput($_POST['vendor'] ?? 0);
130+
$vendor = intval($_POST['vendor'] ?? 0);
131131

132132
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");
133133

0 commit comments

Comments
 (0)