Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Always prefer the sms body from the request over the cookie #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions OpenVBX/controllers/twiml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand All @@ -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))
Expand Down