- Issue created by @ajits
- Assigned to ajits
- Merge request !13Issue #3470509: Allow pattern matching the request URL that might include a query string → (Open) created by ajits
- 🇮🇳India ajits India
Created a PR that should fix this. Also, adjusted the title.
- Issue was unassigned.
- Status changed to Needs review
4 months ago 2:47pm 27 August 2024 - Status changed to Needs work
4 months ago 1:18pm 2 September 2024 - 🇸🇮Slovenia paranojik
Seems to work fine, however the redirect source field help text seems to be inaccurate.
Enter an internal url regex path with named captures. For example: page\/old\/(?P<nr>[0-9a-z]+). Please be aware that certain characters such as "$", or "?" need to be escaped due to it being part of a replacement string.
The special characters are to be escaped because they're part of the regular expression used for matching not because they're part of a replacement string. - Status changed to Needs review
4 months ago 4:22pm 3 September 2024 - 🇮🇳India ajits India
Thank you for your review! I have adjusted the help text. I have also made the change so that the redirect target also supports the query string.
- Status changed to RTBC
3 months ago 1:12pm 5 September 2024 - 🇸🇮Slovenia paranojik
I think this is a very good enhancement. Thanks @ajits!
Marking RTBC. - 🇩🇪Germany captain hindsight
Hey, thanks for this improvement. I needed a redirect from one query parameter to another, i.e from
\?foo=(?P<foo>[0-9a-z]+)
to?bar=<foo>
.With the MR the redirect happens, but the named value is not replaced. I guess this is because
$redirect->getRedirectUrl()->toUriString()
inRegexRedirectRepository::replaceRegexWithActualUrl
delivers encoded url parameters. Using$redirect_regex_url = preg_replace($pattern, $value, urldecode($redirect_regex_url));
solves my problem but maybe there is a better solution.