-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
RSS block: check for description field before rendering excerpt #66985
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Flaky tests detected in 03bcd86. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11830605502
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Thanks for the quick fix!
✅ RSS feeds without descriptions no longer throw warnings
✅ RSS feeds with descriptions continue to display appropriately
❓ Is it worth also fixing the "author" use case as well?
Using the RSS feeds supplied in the test instructions, I saw similar PHP warnings when choosing to display the author while it was missing:
strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated
I think we might need to guard against that here.
Would you like to roll that fix into this PR or do it separately?
In case you'd prefer the latter, I'll approve this one now.
Oh yeah, why not?! Thanks for testing. I didn't come across that but definitely worth fixing here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing up the author side of things as well. Appreciate it 👍
I've taken this for another spin and no longer receive the warnings for missing authors or description in the RSS feeds.
What? and How?
In the RSS block render code, check for author and description (excerpt) before passing to
strip_tags
andhtml_entity_decode
.Why?
Some RSS feeds don't have description or author fields.
And PHP complains:
Noticed while testing #66419
Testing Instructions