Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 19, 2022

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Oct 19, 2022

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:

simplepie/simplepie#753

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

Closes: #1384

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:

simplepie/simplepie#753

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

Closes: #1384
@netlify
Copy link

netlify bot commented Oct 19, 2022

Deploy Preview for selfoss canceled.

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

@jtojnar jtojnar added this to the 2.20 milestone Oct 19, 2022
@jtojnar jtojnar merged commit 20a82e2 into master Oct 19, 2022
@jtojnar jtojnar deleted the simplepie-no-date-workaround branch October 19, 2022 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to parse date in RSS feed
1 participant