From f4e952d7983eb8d0a9077b3faee97bedf2f63b79 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 11 May 2016 09:06:14 -0600 Subject: [PATCH] Check each array if it exist with for every foreach in the operator_panel/index_inc.php. --- app/operator_panel/index_inc.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/operator_panel/index_inc.php b/app/operator_panel/index_inc.php index b2af6399ee..355fde0d10 100644 --- a/app/operator_panel/index_inc.php +++ b/app/operator_panel/index_inc.php @@ -41,10 +41,10 @@ else { $activity = get_call_activity(); -foreach ($activity as $extension => $fields) { +if (isset($activity)) foreach ($activity as $extension => $fields) { if (substr_count($fields['call_group'], ',')) { $tmp = explode(',', $fields['call_group']); - foreach ($tmp as $tmp_index => $tmp_value) { + if (isset($tmp)) foreach ($tmp as $tmp_index => $tmp_value) { if (trim($tmp_value) == '') { unset($tmp[$tmp_index]); } else { $groups[] = $tmp_value; } } @@ -84,7 +84,7 @@ if (sizeof($_SESSION['user']['extensions']) > 0) { $status_options[5]['label'] = $text['label-status_logged_out']; $status_options[5]['style'] = "op_btn_status_logged_out"; - foreach ($status_options as $status_option) { + if (isset($status_options)) foreach ($status_options as $status_option) { echo " \n"; } } @@ -103,7 +103,7 @@ if (permission_exists('operator_panel_eavesdrop')) { echo " "; echo " "; echo " \n"; @@ -122,7 +122,7 @@ if (sizeof($groups) > 0) { echo " \n"; @@ -130,7 +130,7 @@ if (sizeof($groups) > 0) { else { //show buttons echo " "; - foreach ($groups as $group) { + if (isset($groups)) foreach ($groups as $group) { echo " "; } } @@ -145,7 +145,7 @@ echo " "; echo ""; echo "
"; -foreach ($activity as $extension => $ext) { +if (isset($activity)) foreach ($activity as $extension => $ext) { unset($block); //filter by group, if defined @@ -406,7 +406,7 @@ foreach ($activity as $extension => $ext) { if (sizeof($user_extensions) > 0) { echo "
"; - foreach ($user_extensions as $ext_block) { + if (isset($user_extensions)) foreach ($user_extensions as $ext_block) { echo $ext_block; } echo "
"; @@ -425,7 +425,7 @@ else if (sizeof($user_extensions) > 0) { if (sizeof($other_extensions) > 0) { echo "
"; - foreach ($other_extensions as $ext_block) { + if (isset($other_extensions)) foreach ($other_extensions as $ext_block) { echo $ext_block; } echo "
";