From a6ea3abe90b51ba899ee2921e6c4f2f62cb28a3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 10 Jun 2023 13:28:16 +0200 Subject: [PATCH] fix --- admin/api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/admin/api.php b/admin/api.php index 8c10176..d213069 100644 --- a/admin/api.php +++ b/admin/api.php @@ -77,12 +77,14 @@ if (!empty($action) && $_SESSION["password"] == $config["admin_pwd"]){ if ($action == "setcontent" && !empty($_POST["id"]) && !empty($_POST["content"])){ $stmt6 = $mysqli->prepare("INSERT INTO Content (`ContentID`, `Type`, `Content`) VALUES (?, ?, ?);"); + $type = ""; if (!empty($_POST["type"])){ $decoded = base64_decode($_POST["content"]); - $stmt6->bind_param('sss', $_POST["id"], $_POST["type"], $decoded); + $type = $_POST["type"]; + $stmt6->bind_param('sss', $_POST["id"], $type, $decoded); } else{ - $stmt6->bind_param('sss', $_POST["id"], "", $_POST["content"]); + $stmt6->bind_param('sss', $_POST["id"], $type, $_POST["content"]); } $stmt6->execute(); $stmt6->store_result();