-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Describe the bug
Duplicate URLs can be created when the API call to WordPress only matches one item.
To Reproduce
- Create a page in WordPress that sits on the second level of the site, e.g.
/about-us/the-team
- View this page in the frontend to see that it works.
- Manipuate the URL so that
about-uschanges to something else, e.g.
/any-value-in-here/the-team
- Page should be returned. This means the same content can be accessed on multiple duplicate (and incorrect URLs)
Expected behavior
The page should only be returned when the exact request URL matches the full URL in WordPress
Additional context
This only seems to happen when the WordPress API returns exactly one match. This is the endpoint in question:
/wp-json/wp/v2/pages?slug=/page-url-here/
This only requests the final segement of the URL, e.g. in the above example:
/about-us/the-team
The query would be:
/wp-json/wp/v2/pages?slug=/the-team/
If this API response returns more than one match, then this error doesn't occur.
I think this is related to the following recent changes:
Reactions are currently unavailable