treewide: avoid raw SQL concatenation
This commit is contained in:
@@ -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']);
|
||||
|
||||
@@ -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']);
|
||||
|
||||
Reference in New Issue
Block a user