From 551b4263aaf9543cbdb2547da1e1e99e414d0595 Mon Sep 17 00:00:00 2001 From: Thedro Neely Date: Thu, 21 Feb 2019 20:55:44 -0500 Subject: controllers/mail: Set variables if empty --- controllers/mail.controller.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'controllers') diff --git a/controllers/mail.controller.php b/controllers/mail.controller.php index f850ed7..262f999 100644 --- a/controllers/mail.controller.php +++ b/controllers/mail.controller.php @@ -2,15 +2,11 @@ $submit = new Form(); -$submit->name = $_POST['26471']; -$submit->email = $_POST['26472']; -$submit->message = $_POST['26478']; +$submit->name = $_POST['26471'] ?? null; +$submit->email = $_POST['26472'] ?? null; +$submit->message = $_POST['26478'] ?? null; -$spam = false; - -if (isset($_POST['contact'])) { - $spam = $_POST['contact']; -} +$spam = $_POST['contact'] ?? false; if ((bool) $spam == true) { http_response_code(403); -- cgit v1.2.3