From 79e3fd93c2294b2c7965bddcc2f9bfae8b3d04c6 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Thu, 3 Sep 2020 08:50:20 +0200 Subject: [PATCH] Use raw JSON input --- sender.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sender.php b/sender.php index f62c4ad..83f7c1c 100644 --- a/sender.php +++ b/sender.php @@ -10,9 +10,9 @@ use PHPMailer\PHPMailer\Exception; $mailer = new PHPMailer(true); try { - if (!$_POST || !$data=$_POST["data"]) throw new Exception("There is nothing here."); + if (!$_POST) throw new Exception("There is nothing here."); - $json = json_decode($data, true); + $json = json_decode(file_get_contents('php://input')); if (!$json["key"]) throw new Exception("What's the code word?");