CC-5627: Check all Application_Common_DateHelper calculations that use

timezone.

* Removed strtotime usage from AddShowRepeats.php
This commit is contained in:
Albert Santoni 2013-12-11 15:54:13 -05:00
parent 0598c46387
commit 4d77d14d33
1 changed files with 11 additions and 8 deletions

View File

@ -84,7 +84,7 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
public function isValid($formData) {
if (parent::isValid($formData)) {
return $this->checkReliantFields($formData);
return $this->checkReliantFields($formData);
} else {
return false;
}
@ -95,15 +95,18 @@ class Application_Form_AddShowRepeats extends Zend_Form_SubForm
if (!$formData['add_show_no_end']) {
$start_timestamp = $formData['add_show_start_date'];
$end_timestamp = $formData['add_show_end_date'];
$showTimeZone = new DateTimeZone($formData['add_show_timezone']);
$start_epoch = strtotime($start_timestamp);
$end_epoch = strtotime($end_timestamp);
//We're assuming all data is valid at this point (timezone, etc.).
if ($end_epoch < $start_epoch) {
$startDate = new DateTime($start_timestamp, $showTimeZone);
$endDate = new DateTime($end_timestamp, $showTimeZone);
if ($endDate < $startDate) {
$this->getElement('add_show_end_date')->setErrors(array(_('End date must be after start date')));
return false;
}
return true;
}
if (!isset($formData['add_show_day_check'])) {