diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index b08dac1d17..eac1b70398 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -606,7 +606,7 @@ } //recordings $tmp_selected = false; - if (count($recordings) > 0) { + if (is_array($recordings)) { echo "\n"; foreach ($recordings as &$row) { $recording_name = $row["recording_name"]; @@ -626,7 +626,7 @@ echo "\n"; } //phrases - if (count($phrases) > 0) { + if (is_array($phrases)) { echo "\n"; foreach ($phrases as &$row) { if ($ivr_menu_greet_short == "phrase:".$row["phrase_uuid"]) { @@ -908,7 +908,7 @@ } //recordings $tmp_selected = false; - if (count($recordings) > 0) { + if (is_array($recordings)) { echo "\n"; foreach ($recordings as &$row) { $recording_name = $row["recording_name"]; @@ -928,11 +928,7 @@ echo "\n"; } //phrases - $sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - if (count($result) > 0) { + if (is_array($phrases)) { echo "\n"; foreach ($result as &$row) { if ($ivr_menu_invalid_sound == "phrase:".$row["phrase_uuid"]) { @@ -1002,7 +998,7 @@ } //recordings $tmp_selected = false; - if (count($recordings) > 0) { + if (is_array($recordings)) { echo "\n"; foreach ($recordings as &$row) { $recording_name = $row["recording_name"]; @@ -1022,13 +1018,9 @@ echo "\n"; } //phrases - $sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - if (count($result) > 0) { + if (is_array($phrases)) { echo "\n"; - foreach ($result as &$row) { + foreach ($phrases as &$row) { if ($ivr_menu_exit_sound == "phrase:".$row["phrase_uuid"]) { $tmp_selected = true; echo " \n"; @@ -1041,8 +1033,7 @@ echo "\n"; } //sounds - $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']); - if (count($files) > 0) { + if (is_array($sound_files)) { echo "\n"; foreach ($sound_files as $value) { if (strlen($value) > 0) {