From 7efb8609a150e886c22cd6d46ebe19bf1762e21d Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 28 Apr 2016 22:23:15 -0600 Subject: [PATCH] Check the whether the file exists before checking the size. --- app/recordings/recordings.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php index e282a53c66..80104a7292 100644 --- a/app/recordings/recordings.php +++ b/app/recordings/recordings.php @@ -313,9 +313,15 @@ require_once "resources/check_auth.php"; echo " ".$row['recording_name']."\n"; if ($_SESSION['recordings']['storage_type']['text'] != 'base64') { echo " ".$row['recording_filename']."\n"; - $tmp_filesize = filesize($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row['recording_filename']); - $tmp_filesize = byte_convert($tmp_filesize); - echo " ".$tmp_filesize."\n"; + $file_name = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$row['recording_filename']; + if (file_exists($file_name)) { + $file_size = filesize($file_name); + $file_size = byte_convert($file_size); + } + else { + $file_size = ''; + } + echo " ".$file_size."\n"; } if (permission_exists('recording_play') || permission_exists('recording_download')) { echo " ";