From d6bb63b0ccf8207374df831dcc25241fdd834895 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 10 May 2016 22:53:42 -0600 Subject: [PATCH] Update voicemail.php Don't use is_array with glob. --- app/voicemails/resources/classes/voicemail.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/app/voicemails/resources/classes/voicemail.php b/app/voicemails/resources/classes/voicemail.php index 6953ea0c41..ccce808ed2 100644 --- a/app/voicemails/resources/classes/voicemail.php +++ b/app/voicemails/resources/classes/voicemail.php @@ -192,7 +192,7 @@ //delete voicemail recordings folder (includes greetings) $file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id; - if (isset(glob($file_path."/*.*"))) foreach (glob($file_path."/*.*") as $file_name) { + foreach (glob($file_path."/*.*") as $file_name) { unlink($file_name); } @rmdir($file_path); @@ -275,17 +275,13 @@ //delete the recording $file_path = $_SESSION['switch']['voicemail']['dir']."/default/".$_SESSION['domain_name']."/".$this->voicemail_id; if ($this->voicemail_message_uuid != '') { - if (is_array(glob($file_path."/msg_".$this->voicemail_message_uuid.".*"))) { - foreach (glob($file_path."/msg_".$this->voicemail_message_uuid.".*") as $file_name) { - unlink($file_name); - } + foreach (glob($file_path."/msg_".$this->voicemail_message_uuid.".*") as $file_name) { + unlink($file_name); } } else { - if (is_array(glob($file_path."/msg_*.*"))) { - foreach (glob($file_path."/msg_*.*") as $file_name) { - unlink($file_name); //remove all recordings - } + foreach (glob($file_path."/msg_*.*") as $file_name) { + unlink($file_name); //remove all recordings } }