diff --git a/protected/humhub/docs/CHANGELOG.md b/protected/humhub/docs/CHANGELOG.md index dbdf1ec5d8..61a8c77a11 100644 --- a/protected/humhub/docs/CHANGELOG.md +++ b/protected/humhub/docs/CHANGELOG.md @@ -1,6 +1,10 @@ HumHub Change Log ================= +1.4.4 (Unreleased) +--------------------- +- Fix #3908: `DateHelper::parseDateTime()` returns invalid date if given value is not parsable + 1.4.3 (March 4, 2020) --------------------- - Fix #3887: CSS presentation issue for tables wider than the container and videos missing borders (areasas) diff --git a/protected/humhub/libs/DateHelper.php b/protected/humhub/libs/DateHelper.php index f88fe76b1f..a13b86dc73 100644 --- a/protected/humhub/libs/DateHelper.php +++ b/protected/humhub/libs/DateHelper.php @@ -89,12 +89,17 @@ class DateHelper * @param string $value date value * @param string $pattern pattern * @param string $timeValue optional time value - * @return int timestamp in utc + * @return int|false timestamp in utc or false in case value was could not be parsed * @throws \Exception */ public static function parseDateTime($value, $pattern = 'Y-m-d', $timeValue = null) { $ts = self::parseDateTimeToTimestamp($value, $timeValue); + + if($ts === false) { + return false; + } + $dt = new \DateTime(); $dt->setTimestamp($ts);