[wp-trac] [WordPress Trac] #56336: Fatal Error/Warning when invalid `sitemap` query var presented.
WordPress Trac
noreply at wordpress.org
Fri Aug 5 05:48:11 UTC 2022
#56336: Fatal Error/Warning when invalid `sitemap` query var presented.
-------------------------------------------+------------------------------
Reporter: dd32 | Owner: peterwilsoncc
Type: defect (bug) | Status: closed
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version:
Severity: normal | Resolution: fixed
Keywords: php8 has-patch has-unit-tests | Focuses:
-------------------------------------------+------------------------------
Changes (by peterwilsoncc):
* owner: (none) => peterwilsoncc
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"53838" 53838]:
{{{
#!CommitTicketReference repository="" revision="53838"
Sitemaps: Prevent invalid provider names throwing errors.
Validate the requested sitemap is a string before attempting to use it in
a provider. This prevents `WP_Sitemaps_Registry::get_provider()` from
triggering a fatal error in more recent versions of PHP.
The errors can be triggered by items outside the site owner or developers
control (such as a user visiting `?sitemap[foo]=bar`) so the code fails
silently to avoid filling error logs with unfixable errors.
Props costdev, dd32.
Fixes #56336.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56336#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list