Review 10.4 Merged

71917[BUGFIX] Ensure regexp capture group works with relative target

Benni Mack CR +2 V +2 Normal +130 −2 updated 10/29/21, 13:17

Commit message

RedirectService has been using LinkHandler to retrieve
the targeturl, thus supporting all TYPO3 has to offer,
like t3:// support, but also the legacy types for link
fields.

This had the effect, that for regexp redirects with
capture group replacement, this has not been executed,
this leading to incorrect redirects.

This patch assumes for undetermined urls for redirect
targets starting with an '/', that they are meant as
relative target redirects on the current request host.

This patch returns link details as type 'url' with the
relative path in the resolving method for redirects,
thus returning correct relative redirects but ensures
that regexp capture group replacements are done.

Redirects target without a leading slash could not
be handled in the same way, as they are assumed and
resolved as page links with the target as pageid.
These cannot be safely changed. Further tests are
added to cover these cases.

Relative redirects are executed relatively, without
adding a domain and scheme.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 3