You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is caused by get_queried_object() returning false - this isn't a documented return type, but it can occur in a couple of ways. In this case, it's caused by WP_Query setting $query->queried_object to the result of get_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 handles null only, but should handle both null and false 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
If relevant, which editor is affected (or editors):
Block Editor
Gutenberg Editor
Elementor Editor
Classic Editor
Other: n/a, core behaviour
Which browser is affected (or browsers):
Chrome
Firefox
Safari
Other:
Used versions
Device you are using:
Operating system:
PHP version:
WordPress version:
WordPress Theme:
Yoast SEO version:
Gutenberg plugin version:
Elementor plugin version:
Classic Editor plugin version:
Relevant plugins in case of a bug:
(Filing this on behalf of a customer; cc @zsheaib)
The text was updated successfully, but these errors were encountered:
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: