Skip to content

Commit

Permalink
Remove leading whitespace to fix corrupted xml output (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbraswell authored Aug 17, 2022
1 parent 525a59f commit af54b43
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 39 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes

### 4.1.2 (August 17, 2022)
* Fixed an issue where leading whitespace could cause corrupted xml output resulting in failed calls. [#621]

### 4.1.1 (August 14, 2022)
* Use the current logged-in users' settings for the Admin Portal. This suppresses the Twilio error for Zonal Yap Servers for service bodies. [#614]
* Missed call summary metric for reports [#611]
Expand Down
2 changes: 1 addition & 1 deletion legacy/_includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
require_once 'migrations.php';
require_once 'queries.php';
require_once 'logging.php';
$GLOBALS['version'] = "4.1.1";
$GLOBALS['version'] = "4.1.2";
$GLOBALS['settings_allowlist'] = [
'announce_servicebody_volunteer_routing' => [ 'description' => '' , 'default' => false, 'overridable' => true, 'hidden' => false],
'blocklist' => [ 'description' => 'Allows for blocking a specific list of phone numbers https://github.com/bmlt-enabled/yap/wiki/Blocklist' , 'default' => '', 'overridable' => true, 'hidden' => false],
Expand Down
76 changes: 38 additions & 38 deletions legacy/_includes/session.php
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?php
function setConfigForService($service_body_id)
{
if (intval($service_body_id) > 0) {
$service_body_config = getServiceBodyConfig($service_body_id);
<?php
function setConfigForService($service_body_id)
{
if (intval($service_body_id) > 0) {
$service_body_config = getServiceBodyConfig($service_body_id);

if (isset($service_body_config)) {
foreach ($service_body_config as $item => $value) {
if (($item == "twilio_account_sid" || $item == "twilio_auth_token") && isset($_SESSION['call_state'])) {
continue;
}
$_SESSION["override_" . $item] = $value;
}
}
}
}
if (isset($service_body_config)) {
foreach ($service_body_config as $item => $value) {
if (($item == "twilio_account_sid" || $item == "twilio_auth_token") && isset($_SESSION['call_state'])) {
continue;
}
$_SESSION["override_" . $item] = $value;
}
}
}
}

if (!isset($_SESSION['override_service_body_id'])) {
$service_body_id = 0;
if (isset($_REQUEST["service_body_id"]) || isset($_REQUEST["override_service_body_id"])) {
$service_body_id = isset($_REQUEST["service_body_id"]) ? $_REQUEST["service_body_id"] : $_REQUEST["override_service_body_id"];
} elseif (isset($_REQUEST["override_service_body_config_id"])) {
$service_body_id = $_REQUEST["override_service_body_config_id"];
}
if (!isset($_SESSION['override_service_body_id'])) {
$service_body_id = 0;
if (isset($_REQUEST["service_body_id"]) || isset($_REQUEST["override_service_body_id"])) {
$service_body_id = isset($_REQUEST["service_body_id"]) ? $_REQUEST["service_body_id"] : $_REQUEST["override_service_body_id"];
} elseif (isset($_REQUEST["override_service_body_config_id"])) {
$service_body_id = $_REQUEST["override_service_body_config_id"];
}

setConfigForService($service_body_id);
}
setConfigForService($service_body_id);
}

if (!isset($_SESSION['call_state'])) {
$_SESSION['call_state'] = "STARTED";
}
if (!isset($_SESSION['call_state'])) {
$_SESSION['call_state'] = "STARTED";
}

if (!isset($_SESSION['initial_webhook'])) {
$webhook_array = explode("/", $_SERVER['REQUEST_URI']);
$_SESSION['initial_webhook'] = str_replace("&", "&amp;", $webhook_array[count($webhook_array) - 1]);
}
if (!isset($_SESSION['initial_webhook'])) {
$webhook_array = explode("/", $_SERVER['REQUEST_URI']);
$_SESSION['initial_webhook'] = str_replace("&", "&amp;", $webhook_array[count($webhook_array) - 1]);
}

if (isset($_REQUEST)) {
foreach ($_REQUEST as $key => $value) {
if (str_exists($key, "override_")) {
$_SESSION[$key] = $value;
}
}
}
if (isset($_REQUEST)) {
foreach ($_REQUEST as $key => $value) {
if (str_exists($key, "override_")) {
$_SESSION[$key] = $value;
}
}
}

0 comments on commit af54b43

Please sign in to comment.