Fix JSON handling
This commit is contained in:
parent
af208db0a4
commit
ac52f56357
1 changed files with 1 additions and 3 deletions
|
@ -10,9 +10,7 @@ use PHPMailer\PHPMailer\Exception;
|
|||
$mailer = new PHPMailer(true);
|
||||
|
||||
try {
|
||||
if (!$_POST) throw new Exception("There is nothing here.");
|
||||
|
||||
$json = json_decode(file_get_contents('php://input'));
|
||||
if (!$json = json_decode(file_get_contents('php://input'), true)) throw new Exception("There is nothing here.");
|
||||
|
||||
if (!$json["key"]) throw new Exception("What's the code word?");
|
||||
|
||||
|
|
Loading…
Reference in a new issue