From e53e53146c1fb68db646a2c197b1c4730b1f082b Mon Sep 17 00:00:00 2001 From: hacker_marc Date: Mon, 5 Oct 2026 09:12:00 +0000 Subject: [PATCH] Fix Bugs --- api/setup/save.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api/setup/save.php b/api/setup/save.php index 7f6dc19..2903c33 100755 --- a/api/setup/save.php +++ b/api/setup/save.php @@ -12,16 +12,18 @@ if ($_SERVER["REQUEST_METHOD"] !== "POST") { ]); } -if (!isset($_POST["username"]) || !isset($_POST["password"]) || !isset($_POST["password_repeat"])) { +$input = json_decode(file_get_contents("php://input"), true); + +if (!isset($input["username"]) || !isset($input["password"]) || !isset($input["password_repeat"])) { $api->answer(400, [ "error" => "missing_fields", "error_text" => "Some fields are missing" ]); } -$username = $_POST["username"]; -$password = $_POST["password"]; -$password_repeat = $_POST["password_repeat"]; +$username = $input["username"]; +$password = $input["password"]; +$password_repeat = $input["password_repeat"]; // Check Passwords if ($password !== $password_repeat) {