From 4ee232944d8f95243b8f1ac92ef1d47f993cb9f8 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 7 Aug 2012 16:27:18 -0400 Subject: [PATCH] CC-4169: Playlist Builder: Smart Playlist time validates even if time isn't given -fixed --- airtime_mvc/application/common/DateHelper.php | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/airtime_mvc/application/common/DateHelper.php b/airtime_mvc/application/common/DateHelper.php index 455ba8b31..eb32c0393 100644 --- a/airtime_mvc/application/common/DateHelper.php +++ b/airtime_mvc/application/common/DateHelper.php @@ -338,27 +338,29 @@ class Application_Common_DateHelper $retVal['errMsg'] = "'$year-$month-$day' is not a valid date"; } else { // check time - if (isset($timeInfo[0]) && $timeInfo[0] != "") { - $hour = intval($timeInfo[0]); - } else { - $hour = -1; - } - - if (isset($timeInfo[1]) && $timeInfo[1] != "") { - $min = intval($timeInfo[1]); - } else { - $min = -1; - } - - if (isset($timeInfo[2]) && $timeInfo[2] != "") { - $sec = intval($timeInfo[2]); - } else { - $sec = -1; - } - - if ( ($hour < 0 || $hour > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59) ) { - $retVal['success'] = false; - $retVal['errMsg'] = "'$timeInfo[0]:$timeInfo[1]:$timeInfo[2]' is not a valid time"; + if (isset($timeInfo)) { + if (isset($timeInfo[0]) && $timeInfo[0] != "") { + $hour = intval($timeInfo[0]); + } else { + $hour = -1; + } + + if (isset($timeInfo[1]) && $timeInfo[1] != "") { + $min = intval($timeInfo[1]); + } else { + $min = -1; + } + + if (isset($timeInfo[2]) && $timeInfo[2] != "") { + $sec = intval($timeInfo[2]); + } else { + $sec = -1; + } + + if ( ($hour < 0 || $hour > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59) ) { + $retVal['success'] = false; + $retVal['errMsg'] = "'$timeInfo[0]:$timeInfo[1]:$timeInfo[2]' is not a valid time"; + } } } return $retVal;