From 74dd8b23e7a9b9b5d32aa01d6adfc0e4a24c695c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 16 Nov 2021 13:11:59 -0700 Subject: [PATCH] Make sure the file name exists and is not empty. --- app/recordings/resources/classes/switch_recordings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/recordings/resources/classes/switch_recordings.php b/app/recordings/resources/classes/switch_recordings.php index 77549ab6f0..d3de3fc6cd 100644 --- a/app/recordings/resources/classes/switch_recordings.php +++ b/app/recordings/resources/classes/switch_recordings.php @@ -145,7 +145,7 @@ if (!class_exists('switch_recordings')) { //delete recording files if (is_array($filenames) && @sizeof($filenames) != 0) { foreach ($filenames as $filename) { - if (file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename)) { + if (isset($filename) && strlen($filename) > 0 && file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename)) { @unlink($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$filename); } }