diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf57276..2e78f460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [4.4.3] - 2022-03-13 +### Fixed +- PHP 8.1 deprecation notice [#480] + ## [4.4.2] - 2022-02-13 ### Added - Options to customize the CurlClient to perform http queries [#474]. @@ -176,7 +180,9 @@ Full library refactoring. [#468]: https://github.com/oscarotero/Embed/issues/468 [#473]: https://github.com/oscarotero/Embed/issues/473 [#474]: https://github.com/oscarotero/Embed/issues/474 +[#480]: https://github.com/oscarotero/Embed/issues/480 +[4.4.3]: https://github.com/oscarotero/Embed/compare/v4.4.2...v4.4.3 [4.4.2]: https://github.com/oscarotero/Embed/compare/v4.4.1...v4.4.2 [4.4.1]: https://github.com/oscarotero/Embed/compare/v4.4.0...v4.4.1 [4.4.0]: https://github.com/oscarotero/Embed/compare/v4.3.5...v4.4.0 diff --git a/src/ApiTrait.php b/src/ApiTrait.php index f6614625..3dcb781b 100644 --- a/src/ApiTrait.php +++ b/src/ApiTrait.php @@ -96,7 +96,7 @@ public function time(string ...$keys): ?DateTime $time = $this->str(...$keys); $datetime = $time ? date_create($time) : null; - if (!$datetime && ctype_digit($time)) { + if (!$datetime && $time && ctype_digit($time)) { $datetime = date_create_from_format('U', $time); }