Path processors too greedy with URLs ending with sitemap.xml

Created on 3 November 2020, about 4 years ago
Updated 26 May 2023, over 1 year ago

Problem/Motivation

If you have a path on your site (e.g. XML download/Coveo Sitemap.xml) that maps to XXX/sitemap.xml or XXX/YYY/sitemap.xml, the Simple Sitemap module path processor code will change the paths to the paths the module needs. This means that you can not get to valid routes that in in sitemap.xml and have one of these patterns.

Steps to reproduce

ProcessOutbound Case:

Create a view with the URL of foo/bar/sitemap.xml. Try to go to this URL and you will be redirected to /bar/sitemap.xml.

ProcessInbound Case:

Create a view with the URL of bar/sitemap.xml. Try to go to this URL and you will get a 404 error.

Proposed resolution

ProcessOutbound Case:

This should test for the pattern of /sitemap/*/sitemap.xml. Only then should it modify the path.

ProcessInbound Case:

This should check for valid variants before modifying the path.

Remaining tasks

Patch supplied below.

User interface changes

None

API changes

None

Data model changes

None

πŸ“Œ Task
Status

Postponed: needs info

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cgmonroe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024