treewide: avoid raw SQL concatenation

This commit is contained in:
2026-07-25 19:12:03 +09:00
parent 5c54e73c4c
commit 30594b62f7
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -18,8 +18,9 @@ if (!$userManager->hasGroup($uname, 'aktiviteter')) {
$eventID = $_GET['id'];
$query = 'DELETE FROM events WHERE id=\'' . $eventID . '\'';
$query = 'DELETE FROM events WHERE id=:id';
$statement = $pdo->prepare($query);
$statement->bindValue(':id', $eventID, \PDO::PARAM_INT);
$statement->execute();
header('Location: ' . $_SERVER['HTTP_REFERER']);
+2 -1
View File
@@ -18,8 +18,9 @@ if (!$userManager->hasGroup($uname, 'prosjekt')) {
$projectID = $_GET['id'];
$query = 'DELETE FROM projects WHERE id=\'' . $projectID . '\'';
$query = 'DELETE FROM projects WHERE id=:id';
$statement = $pdo->prepare($query);
$statement->bindValue(':id', $projectID, \PDO::PARAM_INT);
$statement->execute();
header('Location: ' . $_SERVER['HTTP_REFERER']);