diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php
index a43f3d2aff..e7cb59859d 100644
--- a/app/call_flows/call_flow_edit.php
+++ b/app/call_flows/call_flow_edit.php
@@ -527,12 +527,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
//sounds
if ($load_sound) {
- global $dir_path, $dir_array;
- $dir_path = $_SESSION['switch']['sounds']['dir'];
- recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
- if (count($dir_array) > 0) {
+ $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
+ if (count($files) > 0) {
echo "\n";
}
//sounds
- $dir_path = $_SESSION['switch']['sounds']['dir'];
- recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
- if (count($dir_array) > 0) {
+ $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
+ if (count($files) > 0) {
echo "\n";
}
//sounds
- $dir_path = $_SESSION['switch']['sounds']['dir'];
- recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
- if (count($dir_array) > 0) {
+ $files = recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
+ if (count($files) > 0) {
echo "