From 70d1eb4cd55a2c6c9dc4950a951ebb34cfa93a4b Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 20 Feb 2019 07:59:51 -0700 Subject: [PATCH] Update destinations.php --- app/destinations/destinations.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/app/destinations/destinations.php b/app/destinations/destinations.php index 33ee43aeda..e5966ad870 100644 --- a/app/destinations/destinations.php +++ b/app/destinations/destinations.php @@ -163,16 +163,20 @@ //add a function to return the action_name function action_name($destination_array, $detail_action) { - foreach($destination_array as $group => $row) { - foreach ($row as $key => $value) { - if ($value == $detail_action) { - //add multi-lingual support - if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$group."/app_languages.php")) { - $language2 = new text; - $text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$group); + if (is_array($destination_array)) { + foreach($destination_array as $group => $row) { + if (is_array($row)) { + foreach ($row as $key => $value) { + if ($value == $detail_action) { + //add multi-lingual support + if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$group."/app_languages.php")) { + $language2 = new text; + $text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$group); + } + //return the group and destination name + return trim($text2['title-'.$group].' '.$key); } - //return the group and destination name - return trim($text2['title-'.$group].' '.$key); + } } } }