Skip to content

Fix fatal error during feed discovery when content is null#627

Merged
akirk merged 1 commit intomainfrom
fix/null-content-feed-discovery
Mar 27, 2026
Merged

Fix fatal error during feed discovery when content is null#627
akirk merged 1 commit intomainfrom
fix/null-content-feed-discovery

Conversation

@akirk
Copy link
Copy Markdown
Owner

@akirk akirk commented Mar 27, 2026

Fixes #619

Summary

  • When wp_safe_remote_get receives a cross-domain redirect it doesn't follow, the response is 3xx and $content stays null. On PHP 8.4, passing null to SimplePie::set_raw_data() throws a TypeError fatal, causing a "critical error" page.
  • Add null content guards in the SimplePie and Microformats feed parsers
  • Detect unfollowed redirects and show the user a helpful message with a clickable link to the redirect target URL

Test plan

  • Enter https://web.brid.gy/currenttime.tv on the Add Friend page and click Next
  • Verify no fatal error occurs
  • If a redirect is not followed, verify the user sees a message like "This URL redirects to … — please use that URL instead"

When wp_safe_remote_get receives a redirect it doesn't follow (e.g.
cross-domain), the response code is 3xx and $content stays null.
On PHP 8.4, passing null to SimplePie::set_raw_data() throws a
TypeError fatal error.

- Add null guards in SimplePie and Microformats parsers
- Detect unfollowed redirects and show the user a helpful message
  with the redirect target URL
@github-actions
Copy link
Copy Markdown
Contributor

Test this PR in WordPress Playground

You can test this pull request directly in WordPress Playground:

Launch WordPress Playground

This will install and activate the plugin with the changes from this PR.

@akirk akirk merged commit 44fbc50 into main Mar 27, 2026
25 checks passed
@akirk akirk deleted the fix/null-content-feed-discovery branch March 27, 2026 18:57
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.

Weird access denied error on attempt to click Follow on account via post boosted by someone in my Friends feed

1 participant