Skip to content

Commit dedd270

Browse files
committed
Ensure dates are set to 12:00:00am UTC
1 parent 07545b7 commit dedd270

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

controller/admin_input.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,9 @@ protected function validate_date($date, $type)
331331
$timestamp = 0;
332332
if (preg_match('#^\d{4}-\d{2}-\d{2}$#', $date))
333333
{
334-
$timestamp = (int) $this->user->get_timestamp_from_format(ext::DATE_FORMAT, $date, new \DateTimeZone('UTC'));
334+
$datetime = \DateTime::createFromFormat(ext::DATE_FORMAT, $date, new \DateTimeZone('UTC'));
335+
$datetime->setTime(0, 0, 0);
336+
$timestamp = $datetime->getTimestamp();
335337

336338
if ($timestamp < time())
337339
{

0 commit comments

Comments
 (0)