[wp-trac] [WordPress Trac] #62777: Force a 404 when no sitemap provider is found

WordPress Trac noreply at wordpress.org
Wed Jan 8 17:31:26 UTC 2025


#62777: Force a 404 when no sitemap provider is found
-------------------------------------------------+-------------------------
 Reporter:  romainmrhenry                        |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  General                              |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by romainmrhenry):

 Replying to [comment:7 tremidkhar]:
 > == Reproduction Report
 > === Description
 >
 > During the Test Team triage, we observed that the current behavior
 involves navigating through the template hierarchy when no sitemap
 provider matches the expected behavior, forcing a 404 error prematurely
 could lead to unexpected results. Further investigation may be required to
 fully understand the issue and determine if any adjustments are needed.
 >
 > === Environment
 > - WordPress: 6.7.1
 > - PHP: 8.3.6
 > - Server: Apache/2.4.62 (Win64) OpenSSL/3.1.6 PHP/8.3.6
 mod_fcgid/2.3.10-dev
 > - Database: mysqli (Server: 11.1.2-MariaDB / Client: mysqlnd 8.3.6)
 > - Browser: Chrome 131.0.0.0
 > - OS: Windows 10/11
 >
 > === Actual Results
 > 1.  A 404 page is displayed when no sitemap provider is found.

 The same could be said for the other conditions where a 404 is already
 being forced in the `render_sitemaps` function.
 Only in this very specific scenario is the template hierarchy used.
 This behavior has no test coverage, no explaining comment and no
 discussion as far as I can tell.

 There also are better escape hatches to disable or manipulate the
 rendering of sitemaps.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62777#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list