From cda602f0aef05712df303074eaf6a7eadece4c77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sun, 25 Feb 2024 20:34:29 +0100 Subject: [PATCH] Fix article --- lib/newsarticle.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/newsarticle.php b/lib/newsarticle.php index 646c22b..0f80108 100644 --- a/lib/newsarticle.php +++ b/lib/newsarticle.php @@ -52,7 +52,8 @@ function addNewsArticle($title="Nazov", $body="Obsah", $privilegeLevel=0) :array $output = ["Status" => "Fail"]; // Default Status is "Fail" if (isLoggedIn() && $privilegeLevel <= $_SESSION["privilege_level"]) { $query = $mysqli->prepare("INSERT INTO NewsArticles (WrittenBy, Title, Body, FileList, PrivilegeLevel) VALUES (?, ?, ?, 0, ?);"); - $query->bind_param("issi", $_SESSION["ID"], htmlspecialchars($title), htmlspecialchars($body), intval($privilegeLevel)); + $minpriv = intval($privilegeLevel); + $query->bind_param("issi", $_SESSION["ID"], htmlspecialchars($title), htmlspecialchars($body), $minpriv); $query->execute(); if ($query->affected_rows > 0) { $output["Status"] = "Success";