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);
|
$mailer = new PHPMailer(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!$_POST) throw new Exception("There is nothing here.");
|
if (!$json = json_decode(file_get_contents('php://input'), true)) throw new Exception("There is nothing here.");
|
||||||
|
|
||||||
$json = json_decode(file_get_contents('php://input'));
|
|
||||||
|
|
||||||
if (!$json["key"]) throw new Exception("What's the code word?");
|
if (!$json["key"]) throw new Exception("What's the code word?");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue