From c84388096bb4cf9ba6ad3dfd9117164a33e4d9e4 Mon Sep 17 00:00:00 2001 From: Ian Littman Date: Thu, 16 Mar 2017 18:32:47 -0500 Subject: [PATCH] Short-circuit when there's no code --- bootstrap/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/routes.php b/bootstrap/routes.php index ab7be16..4108cd7 100644 --- a/bootstrap/routes.php +++ b/bootstrap/routes.php @@ -25,7 +25,7 @@ $qs = $req->getQueryParams(); $code = $qs['text']; - if ($rs->recordEntry($code, $qs['msisdn'])) { + if ($code && $rs->recordEntry($code, $qs['msisdn'])) { $this->sms->send($qs['msisdn'], 'Your entry into ' . $rs->getNameByCode($code) . ' has been received!'); } return $res->withStatus(200, "OK")->write('Message received.');