Project

General

Profile

Actions

Bug #20860

closed

is_home() issue in buddypress-docs linked to sitemap mods

Added by Boone Gorges 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
-
Target version:
Start date:
2024-08-30
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Previously: #17010

In that ticket, Ray introduced a potential privacy bug where the sitemap included private BuddyPress Docs. See https://github.com/cuny-academic-commons/cac/commit/881caa13e1fec7ed291e7c00c691148e15e41965

However, the did_action( 'wp_sitemaps_init' ) check is too broad. That action doesn't just run when a sitemap is being generated, but on every pageload. https://github.com/cuny-academic-commons/cac/blob/5cd49f47e304939fc3674fff7380befc364c31ab/wp-includes/default-filters.php#L516

In order to detect a sitemaps request, we may need to do something like WP does: https://github.com/cuny-academic-commons/cac/blob/5cd49f47e304939fc3674fff7380befc364c31ab/wp-includes/sitemaps/class-wp-sitemaps.php#L167

As it stands, the wp_sitemaps_init check is (somehow) causing is_home() to return true when it shouldn't. See https://github.com/boonebgorges/buddypress-docs/issues/757


Related issues

Related to CUNY Academic Commons - Support #17010: robots.txt ResolvedRaymond Hoh2022-10-12

Actions
Actions #1

Updated by Boone Gorges 3 months ago

Actions #2

Updated by Raymond Hoh 3 months ago

  • Status changed from New to Staged for Production Release

Thanks for finding the is_home() cause, Boone! I've added a better sitemap check during the 'pre_get_posts' hook in https://github.com/cuny-academic-commons/cac/commit/ec16a3dba3ad6cc8ecd5c93092c2b738708eb290. I've pushed the fix to production as well.

With regards to BuddyPress Docs, I was able to duplicate the is_home() bug on another non-Commons install. I'll see if I can get a list of steps to reproduce.

Actions #3

Updated by Boone Gorges 2 months ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF