mirror of
https://github.com/jbcr/core.git
synced 2026-04-29 19:53:08 +02:00
Prevant negative dates ("Before year 0") in Content
This commit is contained in:
@@ -735,6 +735,11 @@ class Content
|
||||
$dateTime->setTimezone($utc);
|
||||
}
|
||||
|
||||
// Prevent dates before the year 0, because MySQL chokes on those
|
||||
if ((int) $dateTime->format("Y") < 1) {
|
||||
$dateTime->setDate(0, 1, 1);
|
||||
}
|
||||
|
||||
return $dateTime;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user