fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.36k stars 343 forks source link

spouts\rss\feed: Work around SimplePie returning incorrect date value #1385

Closed jtojnar closed 1 year ago

jtojnar commented 1 year ago

When SimplePie is unable to parse an item update date, it will return false, breaking the promise in PHPDoc. Since we do not expect it, we would try to treat the non-null value as a an int and try to create a date object from it, which lead to the affected sources failing to update with the following error:

Exception: DateTimeImmutable::__construct(): Failed to parse time string (@) at position 0 (@)

I have created an upstream PR:

https://github.com/simplepie/simplepie/pull/753

But until that is available, let’s work around the issue by also guarding against false.

Closes: https://github.com/fossar/selfoss/issues/1384

netlify[bot] commented 1 year ago

Deploy Preview for selfoss canceled.

Name Link
Latest commit 20a82e2768e0746101d8ef78acf14ee2633fb7a0
Latest deploy log https://app.netlify.com/sites/selfoss/deploys/634f4fb62a4fe400090946a8