From 7b69053b1f3e1459088585c8e24b6491d21cdfe1 Mon Sep 17 00:00:00 2001 From: Marc-Alexandre Ghaly Date: Mon, 18 Dec 2023 22:53:47 -0500 Subject: [PATCH] Issue #65: fix: DB error - Linkid variable string numeric value checked --- classes/persistent/linkhistory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/persistent/linkhistory.php b/classes/persistent/linkhistory.php index 8cf69fd..b758987 100644 --- a/classes/persistent/linkhistory.php +++ b/classes/persistent/linkhistory.php @@ -73,7 +73,7 @@ public static function delete_link_history($linkids) { public static function count_clicked_links($userid, $noticeid, $linkid = 0) { global $DB; $params = []; - if ($linkid > 0) { + if ($linkid > 0 && is_numeric($linkid)) { $wheresql = "WHERE h.userid = :userid AND l.noticeid = :noticeid AND h.hlinkid = :hlinkid"; $params = ['hlinkid' => $linkid]; } else {