Minor - fix interval validation

pull/2958/head
Julio Montoya 6 years ago
parent 12ca5444fa
commit 145878b774
  1. 3
      main/exercise/exercise.class.php

@ -9916,7 +9916,7 @@ class Exercise
); );
if (!empty($value)) { if (!empty($value)) {
$value = (int) $value; $value = (int) $value;
$endDate = new DateTime($exerciseResultInfo['exe_date']); $endDate = new DateTime($exerciseResultInfo['exe_date'], new DateTimeZone('UTC'));
$endDate->add(new DateInterval('PT'.$value.'M')); $endDate->add(new DateInterval('PT'.$value.'M'));
if (time() > $endDate->getTimestamp()) { if (time() > $endDate->getTimestamp()) {
return false; return false;
@ -9924,6 +9924,7 @@ class Exercise
} }
return true; return true;
} }
/** /**
* @return int * @return int
*/ */

Loading…
Cancel
Save