Skip to content

Commit

Permalink
fix for bad page dates + changelog update
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Feb 3, 2024
1 parent ad8b1b7 commit f9f5781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,8 +1,11 @@
# v1.7.45
## mm/dd/2024

1. [](#news)
* Added new Image trait for `decoding` attribute [#3796](https://github.com/getgrav/grav/pull/3796)
1. [](#bugfix)
* Fixed some multibyte issues in Inflector class [#732](https://github.com/getgrav/grav/issues/732)
* Fallback to paeg modified date if Page date provided is invalid and can't be parsed [getgrav/grav-plugin-admin#2394](https://github.com/getgrav/grav-plugin-admin/issues/2394)

# v1.7.44
## 01/05/2024
Expand Down
6 changes: 5 additions & 1 deletion system/src/Grav/Common/Utils.php
Expand Up @@ -1330,7 +1330,11 @@ public static function date2timestamp($date, $format = null)
if ($dateformat) {
$datetime = DateTime::createFromFormat($dateformat, $date);
} else {
$datetime = new DateTime($date);
try {
$datetime = new DateTime($date);
} catch (Exception $e) {
$datetime = false;
}
}

// fallback to strtotime() if DateTime approach failed
Expand Down

0 comments on commit f9f5781

Please sign in to comment.