From 06c1d4cffc36d7e1397852127ccd7748b0d74db4 Mon Sep 17 00:00:00 2001 From: Natorator Date: Sun, 17 Apr 2016 18:41:19 -0700 Subject: [PATCH] Always prefer the sms body from the request over the cookie closes https://github.com/twilio/OpenVBX/issues/341 and perhaps https://github.com/twilio/OpenVBX/issues/266 --- OpenVBX/controllers/twiml.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/OpenVBX/controllers/twiml.php b/OpenVBX/controllers/twiml.php index e3a2261f..0f9b921d 100644 --- a/OpenVBX/controllers/twiml.php +++ b/OpenVBX/controllers/twiml.php @@ -174,7 +174,7 @@ private function applet($flow_id, $inst_id, $type = 'voice') switch($type) { case 'sms': - if(isset($_REQUEST['Body']) && $inst_id == 'start') + if(isset($_REQUEST['Body'])) { $_COOKIE['sms-body'] = $_REQUEST['Body']; $sms = $_REQUEST['Body']; @@ -185,7 +185,6 @@ private function applet($flow_id, $inst_id, $type = 'voice') else { $sms = isset($_COOKIE['sms-body'])? $_COOKIE['sms-body'] : null; - set_cookie('sms-body', null, time()-3600); } $sms_data = $flow->sms_data; if(!empty($sms_data))