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";