From 6e78dea6ecaf3f204efedfaf94b1d40fbdb2bb85 Mon Sep 17 00:00:00 2001 From: matmurdock Date: Thu, 4 Oct 2018 10:47:55 -0600 Subject: [PATCH] This resolves an issue with the Snom phones See ticket here: https://github.com/provisioner/Provisioner/issues/234 --- Endpointman_Config.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Endpointman_Config.class.php b/Endpointman_Config.class.php index 62facc9b..c6379b32 100644 --- a/Endpointman_Config.class.php +++ b/Endpointman_Config.class.php @@ -1654,14 +1654,16 @@ function merge_data($path, $template_list, $maxlines = 12) { $var_nam = "loop|" . str_replace("\$", "", $name[0]) . "_" . $i; foreach ($item['data']['item'] as $item_loop) { if ($item_loop['type'] != 'break') { - $z_tmp = explode("_", $item_loop['variable']); - $z = $z_tmp[1]; - $items_loop[$var_nam][$z] = $item_loop; - $items_loop[$var_nam][$z]['description'] = str_replace('{$count}', $i, $items_loop[$var_nam][$z]['description']); - $items_loop[$var_nam][$z]['variable'] = str_replace('_', '_' . $i . '_', $items_loop[$var_nam][$z]['variable']); - $items_loop[$var_nam][$z]['default_value'] = isset($items_loop[$var_nam][$z]['default_value']) ? $items_loop[$var_nam][$z]['default_value'] : ''; - $items_loop[$var_nam][$z]['loop'] = TRUE; - $items_loop[$var_nam][$z]['loop_count'] = $i; + if (!empty($item_loop['variable'])){ + $z_tmp = explode("_", $item_loop['variable']); + $z = $z_tmp[1]; + $items_loop[$var_nam][$z] = $item_loop; + $items_loop[$var_nam][$z]['description'] = str_replace('{$count}', $i, $items_loop[$var_nam][$z]['description']); + $items_loop[$var_nam][$z]['variable'] = str_replace('_', '_' . $i . '_', $items_loop[$var_nam][$z]['variable']); + $items_loop[$var_nam][$z]['default_value'] = isset($items_loop[$var_nam][$z]['default_value']) ? $items_loop[$var_nam][$z]['default_value'] : ''; + $items_loop[$var_nam][$z]['loop'] = TRUE; + $items_loop[$var_nam][$z]['loop_count'] = $i; + } } elseif ($item_loop['type'] == 'break') { $items_loop[$var_nam]['break_' . $break_count]['type'] = 'break'; $break_count++;