Bug #89799

Capture groups for regex redirects are not respected in target

Added by Stefan P about 2 months ago. Updated 13 days ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
-
Start date:
2019-11-29
Due date:
% Done:

100%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Steps to reproduce:

  1. Create a redirect
  2. source: for example #^/foo/(.*)#
  3. target: http://another.domain/$1
  4. go to your.domain/foo/bar
  5. Redirect is triggered but literally to to http://another.domain/$1

Expected result: Redirect is made to http://another.domain/bar

Parsing the capture groups is not simply defect but actually not implemented at all. I flagged this explicitly as a bug (not as a feature) however, because the documentation does not clearly state this limitation and the module and GUI clearly allow regex-enabled redirects, so everything is suggesting that this must work and the backend editors and developers are left alone wasting their time to find out the hard way that this is not working - which is clearly a bug then.

Associated revisions

Revision 5f6f2abe (diff)
Added by Guido Schmechel 13 days ago

[BUGFIX] Replace regexp capture groups for redirects

The capture group in the redirect target are now replaced,
so redirects with regular expressions are working
referencing the original URL.

Resolves: #89799
Releases: master, 9.5
Change-Id: Ib624e6c7b40dd09ec090e72339ad9aae1211cc4e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62781
Tested-by: Benni Mack <>
Tested-by: TYPO3com <>
Tested-by: Susanne Moog <>
Reviewed-by: Benni Mack <>
Reviewed-by: Susanne Moog <>

Revision dc827657 (diff)
Added by Guido Schmechel 13 days ago

[BUGFIX] Replace regexp capture groups for redirects

The capture group in the redirect target are now replaced,
so redirects with regular expressions are working
referencing the original URL.

Resolves: #89799
Releases: master, 9.5
Change-Id: Ib624e6c7b40dd09ec090e72339ad9aae1211cc4e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62884
Tested-by: TYPO3com <>
Tested-by: Daniel Goerz <>
Tested-by: Susanne Moog <>
Reviewed-by: Daniel Goerz <>
Reviewed-by: Susanne Moog <>

History

#1 Updated by Stefan P about 2 months ago

Forget a step to reproduce: enable the regex toggle in the redirect, obviously.

#2 Updated by Riccardo De Contardi about 2 months ago

  • Category set to Link Handling, Site Handling & Routing

#3 Updated by Bastian Stargazer about 2 months ago

Ah thats why! This behaviour drove me crazy few month back! I thought I was just to dumb to use the regexp here because it was not working at all.
Good to know that it is a bug. I hope it will work sometimes in the future, thanks for pointing that out.

#4 Updated by Gerrit Code Review 30 days ago

  • Status changed from New to Under Review

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

#5 Updated by Gerrit Code Review 30 days ago

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

#6 Updated by Gerrit Code Review 30 days ago

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

#7 Updated by Gerrit Code Review 29 days ago

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

#8 Updated by Gerrit Code Review 13 days ago

Patch set 1 for branch 9.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/+/62884

#9 Updated by Guido Schmechel 13 days ago

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

#10 Updated by Gerrit Code Review 13 days ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch 9.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/+/62884

#11 Updated by Guido Schmechel 13 days ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF