Actions
Bug #104179
openinconsistent url encoding in redirects
Status:
New
Priority:
Should have
Assignee:
-
Category:
Link Handling & Redirect Handling
Target version:
-
Start date:
2024-06-21
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
I think there is a bug with inconsistent url encoding inside the redirect extension.
I want to match an url with parameters like url?foo[bar]=42
So i use #^/url\?foo%5Bbar%5D=([0-9]+)# as regex and as new target /path2/$1
The thing is, this will not work and outputs the target path without replacements.
After some debugging i found out that the url is first matched with the urldecoded version "url?foo%5Bbar%5D=42".
But for the later preg_match which generates the capture groups to build the target uri, it is matched against "url?foo[bar]=42".
As a workaround i now use as regex #^/url\?foo(?:%5B|\[)bar(?:%5D|\]=([0-9]+)# which matches in both cases.
I found a related task #94934 which introduced this change.
Updated by Garvin Hicking 5 months ago
- Related to Task #94934: Change RedirectService.php to use rawurldecode to replaceRegExpCaptureGroup preg_match for encoded urls (such as cyrillic) added
Actions