From 64e33a235d81af96c034eac419e693f7b16be720 Mon Sep 17 00:00:00 2001 From: Robbt Date: Sat, 2 Mar 2019 20:36:02 -0500 Subject: [PATCH] added check to prevent unnecessary conversion to seconds --- airtime_mvc/application/models/Scheduler.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 47387fca0..3d8eb1185 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -858,8 +858,14 @@ final class Application_Model_Scheduler // default fades are in seconds // we need to convert to '00:00:00' format - $file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']); - $file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']); + // added a check to only run the conversion if they are in seconds format + // otherwise php > 7.1 throws errors + if (is_numeric($file['fadein'])) { + $file['fadein'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadein']); + } + if (is_numeric($file['fadeout'])) { + $file['fadeout'] = Application_Common_DateHelper::secondsToPlaylistTime($file['fadeout']); + } switch ($file["type"]) { case 0: