From 06455c65e396a64d970ae75ec38e690d3855fdf8 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Wed, 25 Apr 2012 12:07:58 -0400 Subject: [PATCH] CC-3714: Create show with start time as 0xx:xx will freeze the browser -fixed --- .../application/forms/AddShowAbsoluteRebroadcastDates.php | 2 +- airtime_mvc/application/forms/AddShowRebroadcastDates.php | 2 +- airtime_mvc/application/forms/AddShowWhen.php | 2 +- airtime_mvc/application/forms/DateRange.php | 6 +++--- airtime_mvc/application/forms/ShowBuilder.php | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php index b936960fc..9107012d9 100644 --- a/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowAbsoluteRebroadcastDates.php @@ -23,7 +23,7 @@ class Application_Form_AddShowAbsoluteRebroadcastDates extends Zend_Form_SubForm $text->setAttrib('class', 'input_text'); $text->addFilter('StringTrim'); $text->addValidator('date', false, array('HH:mm')); - $text->addValidator('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')); + $text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')); $text->setRequired(false); $text->setDecorators(array('ViewHelper')); $this->addElement($text); diff --git a/airtime_mvc/application/forms/AddShowRebroadcastDates.php b/airtime_mvc/application/forms/AddShowRebroadcastDates.php index 58afa7f0c..42d1f8e86 100644 --- a/airtime_mvc/application/forms/AddShowRebroadcastDates.php +++ b/airtime_mvc/application/forms/AddShowRebroadcastDates.php @@ -28,7 +28,7 @@ class Application_Form_AddShowRebroadcastDates extends Zend_Form_SubForm $text->setAttrib('class', 'input_text'); $text->addFilter('StringTrim'); $text->addValidator('date', false, array('HH:mm')); - $text->addValidator('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')); + $text->addValidator('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')); $text->setRequired(false); $text->setDecorators(array('ViewHelper')); $this->addElement($text); diff --git a/airtime_mvc/application/forms/AddShowWhen.php b/airtime_mvc/application/forms/AddShowWhen.php index b3861602a..4372a9b6c 100644 --- a/airtime_mvc/application/forms/AddShowWhen.php +++ b/airtime_mvc/application/forms/AddShowWhen.php @@ -60,7 +60,7 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('HH:mm')), - array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Time format should be HH:mm')))) ->setDecorators(array('ViewHelper')); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); diff --git a/airtime_mvc/application/forms/DateRange.php b/airtime_mvc/application/forms/DateRange.php index 283367c73..5d04696ed 100644 --- a/airtime_mvc/application/forms/DateRange.php +++ b/airtime_mvc/application/forms/DateRange.php @@ -32,7 +32,7 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('HH:mm')), - array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')))) ->setDecorators(array('ViewHelper')); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -60,9 +60,9 @@ class Application_Form_DateRange extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('HH:mm')), - array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')))) ->setDecorators(array('ViewHelper')); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); } -} \ No newline at end of file +} diff --git a/airtime_mvc/application/forms/ShowBuilder.php b/airtime_mvc/application/forms/ShowBuilder.php index cc1a7c01c..a5198ec6f 100644 --- a/airtime_mvc/application/forms/ShowBuilder.php +++ b/airtime_mvc/application/forms/ShowBuilder.php @@ -40,7 +40,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('HH:mm')), - array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')))) ->setDecorators(array('ViewHelper')); $startTime->setAttrib('alt', 'time'); $this->addElement($startTime); @@ -68,7 +68,7 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm ->setValidators(array( 'NotEmpty', array('date', false, array('HH:mm')), - array('regex', false, array('/^[0-9:]+$/', 'messages' => 'Invalid character entered')))) + array('regex', false, array('/^[0-2]?[0-9]:[0-5][0-9]$/', 'messages' => 'Invalid character entered')))) ->setDecorators(array('ViewHelper')); $endTime->setAttrib('alt', 'time'); $this->addElement($endTime); @@ -107,4 +107,4 @@ class Application_Form_ShowBuilder extends Zend_Form_SubForm return $showNames; } -} \ No newline at end of file +}