[wp-trac] [WordPress Trac] #56336: Fatal Error/Warning when invalid `sitemap` query var presented.

WordPress Trac noreply at wordpress.org
Fri Aug 5 03:36:32 UTC 2022


#56336: Fatal Error/Warning when invalid `sitemap` query var presented.
--------------------------+------------------------------
 Reporter:  dd32          |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Sitemaps      |    Version:
 Severity:  normal        |   Keywords:  php8 needs-patch
  Focuses:                |
--------------------------+------------------------------
 A request such as https://example.org/?sitemap[foo]=bar will result in a
 fatal error being generated under PHP8, and a warning under PHP7.

 {{{
 PHP 7.4:
 E_WARNING: Illegal offset type in isset or empty in wp-includes/sitemaps
 /class-wp-sitemaps-registry.php:68


 PHP8.1:
 Fatal error: Uncaught Error: Illegal offset type in isset or empty
 in wp-includes/sitemaps/class-wp-sitemaps-registry.php on line 68

 Call stack:
 WP_Sitemaps_Registry::get_provider()
 wp-includes/sitemaps.php:114
 get_sitemap_url()
 wp-includes/canonical.php:428
 redirect_canonical()
 wp-includes/class-wp-hook.php:307
 ...
 }}}

 This is partially related to #17737

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56336>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list