Project

General

Profile

Actions

Bug #101191

closed

Redirects with regexp endabled and same urls, but one with additional query params matching the wrong one first

Added by Marc Bastian Heinrichs 10 months ago. Updated 10 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Redirect Handling
Target version:
-
Start date:
2023-06-28
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Example:
Need to match on two urls, each with different variants, that's why regexp is enabled, but one differs only by the query params from the other:

  1. /foo/(different_part)bar.html
  2. /foo/(different_part)bar.html?type=101

Created two regexp redirects records in this order (important):

  1. /\/foo\/(.*)bar.html$/ with target A
  2. /\/foo\/(.*)bar.html\?type=101/ with target B

With url 2 record 1 matches first, which is wrong. Record 2 should match first
If the redirect records are created the other way round it works correct, but this is not the solution.

IMO the foreach for the regexp redirects in RedirectService::matchRedirect needs to be run though twice, first with query and second one without, instead of a single run.

Actions #1

Updated by Gerrit Code Review 10 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #2

Updated by Stefan Bürk 10 months ago

  • Assignee set to Stefan Bürk
Actions #3

Updated by Gerrit Code Review 10 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #4

Updated by Gerrit Code Review 10 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #5

Updated by Gerrit Code Review 10 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #6

Updated by Gerrit Code Review 10 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #7

Updated by Gerrit Code Review 10 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79967

Actions #8

Updated by Gerrit Code Review 10 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80056

Actions #9

Updated by Stefan Bürk 10 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #10

Updated by Gerrit Code Review 10 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80079

Actions #11

Updated by Stefan Bürk 10 months ago

  • Status changed from Under Review to Resolved
Actions

Also available in: Atom PDF