From 1bb04296a9bb2caa39523853784799d4042dfcd8 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 13 Apr 2012 12:05:59 -0400 Subject: [PATCH] CC-3639: Preferences-> Fade In is interpreted improperly (it is insanely high) - the regular exp check in model class was wrong --- airtime_mvc/application/forms/LiveStreamingPreferences.php | 2 +- airtime_mvc/application/models/Scheduler.php | 2 +- .../application/models/airtime/CcPlaylistcontents.php | 4 ++-- airtime_mvc/application/models/airtime/CcSchedule.php | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index d40f81c31..d97530c2a 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -14,7 +14,7 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm $transition_fade = new Zend_Form_Element_Text("transition_fade"); $transition_fade->setLabel("Switch Transition Fade (s)") ->setFilters(array('StringTrim')) - ->addValidator('regex', false, array('/^[0-5][0-9](\.\d{1,6})?$/', + ->addValidator('regex', false, array('/^[0-9]{1,2}(\.\d{1,6})?$/', 'messages' => 'enter a time in seconds 00{.000000}')) ->setValue($defaultFade) ->setDecorators(array('ViewHelper')); diff --git a/airtime_mvc/application/models/Scheduler.php b/airtime_mvc/application/models/Scheduler.php index 38f6d3fb0..c700387bc 100644 --- a/airtime_mvc/application/models/Scheduler.php +++ b/airtime_mvc/application/models/Scheduler.php @@ -321,7 +321,7 @@ class Application_Model_Scheduler { else { $sched = new CcSchedule(); } - + Logging::log(print_r($file,true)); $sched->setDbStarts($nextStartDT) ->setDbEnds($endTimeDT) ->setDbFileId($file['id']) diff --git a/airtime_mvc/application/models/airtime/CcPlaylistcontents.php b/airtime_mvc/application/models/airtime/CcPlaylistcontents.php index 441207585..b5125de32 100644 --- a/airtime_mvc/application/models/airtime/CcPlaylistcontents.php +++ b/airtime_mvc/application/models/airtime/CcPlaylistcontents.php @@ -46,7 +46,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents { if ($v instanceof DateTime) { $dt = $v; } - else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { $dt = DateTime::createFromFormat("s.u", $v); } else { @@ -74,7 +74,7 @@ class CcPlaylistcontents extends BaseCcPlaylistcontents { if ($v instanceof DateTime) { $dt = $v; } - else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { $dt = DateTime::createFromFormat("s.u", $v); } else { diff --git a/airtime_mvc/application/models/airtime/CcSchedule.php b/airtime_mvc/application/models/airtime/CcSchedule.php index 9db58807e..75a01e758 100644 --- a/airtime_mvc/application/models/airtime/CcSchedule.php +++ b/airtime_mvc/application/models/airtime/CcSchedule.php @@ -110,7 +110,7 @@ class CcSchedule extends BaseCcSchedule { if ($v instanceof DateTime) { $dt = $v; } - else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { $dt = DateTime::createFromFormat("s.u", $v); } else { @@ -120,7 +120,6 @@ class CcSchedule extends BaseCcSchedule { throw new PropelException('Error parsing date/time value: ' . var_export($v, true), $x); } } - $this->fade_in = $dt->format('H:i:s.u'); $this->modifiedColumns[] = CcSchedulePeer::FADE_IN; @@ -138,7 +137,7 @@ class CcSchedule extends BaseCcSchedule { if ($v instanceof DateTime) { $dt = $v; } - else if (preg_match('/^[0-5][0-9](\.\d{1,6})?$/', $v)) { + else if (preg_match('/^[0-9]{1,2}(\.\d{1,6})?$/', $v)) { $dt = DateTime::createFromFormat("s.u", $v); } else {