Complete security audit fixes

This commit is contained in:
Thanakorn S
2026-03-09 14:31:39 +07:00
parent 93d903c4b2
commit 7cb78d013b
33 changed files with 317 additions and 313 deletions
+8 -8
View File
@@ -1,7 +1,6 @@
<?php
session_start();
require '../../../preset.php';
require '../../../assets/utils/db_auth.php';
$id = (int)$data['id'];
@@ -10,14 +9,15 @@
$sql = "SELECT `log`
FROM md_product
WHERE
company_id = {$company_id} and
id = {$id}";
company_id = :company_id and
id = :id ";
$sth = $pdo2->prepare($sql);
$sth->execute();
if ($sth->errorInfo()[0] != "00000" && !empty($sth->errorInfo()[0])) {
$answer["message"] = (empty($sth->errorInfo()[2])) ? $sth->errorInfo()[0] : $sth->errorInfo()[2];
exit(json_encode($answer));
}
$sth->execute([
":company_id" => $company_id,
":id" => $id
]);
db_check($sth, $answer);
$row = $sth->fetch(PDO::FETCH_ASSOC);
$table_log = json_decode($row['log'] ?? '[]', true);