diff --git a/CHANGELOG.md b/CHANGELOG.md index d4e95fe..e53ca6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.2] - 2023-08-13 + +### Fixed + - Fixed issue in `\RssLib\Objects\RssFeed > Guid` where `guid` isn't correctly parsed if the "isPermaLink" attribute is missing. + ## [1.0.1] - 2023-08-13 diff --git a/project.json b/project.json index b8efd73..50d9434 100644 --- a/project.json +++ b/project.json @@ -13,7 +13,7 @@ "description": "A library used to parse RSS feeds", "company": "Nosial", "copyright": "Copyright (c) 2022-2023 Nosial", - "version": "1.0.0", + "version": "1.0.2", "uuid": "f24416e8-39f0-11ee-8dcf-f362baa8b68c" }, "build": { diff --git a/src/RssLib/Objects/RssFeed/Guid.php b/src/RssLib/Objects/RssFeed/Guid.php index 715a69d..1829342 100644 --- a/src/RssLib/Objects/RssFeed/Guid.php +++ b/src/RssLib/Objects/RssFeed/Guid.php @@ -22,10 +22,18 @@ /** * Public Constructor * - * @param array $data + * @param array|string $data */ - public function __construct(array $data) + public function __construct(array|string $data) { + if(is_string($data)) + { + $data = [ + 'guid' => $data, + 'guid_isPermalink' => false + ]; + } + if(!array_key_exists('guid', $data)) { throw new InvalidArgumentException('Missing required key guid for guid');