-
Notifications
You must be signed in to change notification settings - Fork 877
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 feeds cause fatal error with missing/invalid user #21381
Labels
Comments
2 tasks
Hi @rmccue Thanks for using the Yoast SEO plugin and also for creating the issue. The issue you have noticed seems to be related to this one: #20436 or #20000. If you are interested, you can also contribute to our plugin by submitting a PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please give us a description of what happened
RSS (etc) feeds can cause a fatal error due to invalid typing from core.
To Reproduce
Step-by-step reproduction instructions
Expected results
Actual results
Screenshots, screen recording, code snippet
On these lines:
wordpress-seo/src/integrations/front-end/feed-improvements.php
Lines 144 to 147 in 0044dfb
This is caused by
get_queried_object()
returningfalse
- this isn't a documented return type, but it can occur in a couple of ways. In this case, it's caused byWP_Query
setting$query->queried_object
to the result ofget_userdata()
, which can return false in various cases.While it shouldn't return
false
for a valid author page, it is possible to do so based on other behaviour or plugins, which then becomes a fatal error rather than a 500 or 404. The code in Yoast handlesnull
only, but should handle bothnull
andfalse
return values. (Additionally, core should really be coercing this from a false to a null so that it's typesafe, but it doesn't right now.)Technical info
Used versions
(Filing this on behalf of a customer; cc @zsheaib)
The text was updated successfully, but these errors were encountered: