Default destination type to inbound. Use is_array where it is required

This commit is contained in:
markjcrane 2023-05-17 16:03:36 -06:00
parent 74959e69c7
commit 10a4ceae65
2 changed files with 6 additions and 6 deletions

View File

@ -100,7 +100,7 @@
}
//set the type
$destination_type = '';
$destination_type = 'inbound';
if (!empty($_REQUEST['type'])) {
switch ($_REQUEST['type']) {
case 'inbound': $destination_type = 'inbound'; break;

View File

@ -675,7 +675,7 @@ if (!class_exists('destinations')) {
$select_value = $row['select_value'][$destination_type];
$select_label = $row['select_label'];
foreach ($row['field'] as $key => $value) {
if ($key == 'destination' and !empty($value)){
if (!empty($key) && $key == 'destination' && !empty($value) && is_array($value)){
if (!empty($value['type']) && $value['type'] == 'csv') {
$array = explode($value['delimiter'], $data[$key]);
$select_value = str_replace("\${destination}", $array[0], $select_value);