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 {