Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.
96516[BUGFIX] Use relative return URL in the file list
Commit message
Test this change
Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch
- Check out patch set 3
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/16/96516/3 && git checkout FETCH_HEAD - Cherry-pick onto main
-
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/16/96516/3 && git cherry-pick FETCH_HEAD
Review
-
Code review CR +1 Needs a vote
- Simon Schaufelberger +1
- Benni Mack +1
-
Verified V +1 Needs a vote
- Simon Schaufelberger +1
- Benni Mack +1
- core-ci +1 CI
Issues 1
Files 3
Review log 1215
-
Georg Ringer uploaded patch set 1 10/08/26, 05:35
-
Georg Ringer commented on patch set 1 10/08/26, 05:35
This change is ready for review. -
core-ci voted on patch set 1 V +1 10/08/26, 05:43 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110437
-
Wolfgang Klinger commented on patch set 1 CR +1 10/08/26, 13:46
This fixes the reported case for me. The root cause is a bit broader than non-ASCII characters. sanitizeLocalUrl() decodes the URL and then validates the decoded version, so other encoded characters fail the same way. For example, an absolute returnUrl with %20 in the query is still denied with this patch. Maybe we could validate the original (still encoded) URL instead of the decoded one? It already passed the character whitelist, so it's plain ASCII and needs no re-encoding. That would cover all these cases at once. One behaviour would change: a fully encoded absolute URL like http%3A%2F%2Flocalhost%2Ftypo3%2F would no longer be accepted. Two old test cases (sanitizeLocalUrlAcceptsEncodedValidUrls) expect that. But it never really worked anyway: a browser reads such a value as a relative path, not as a URL, so the redirect goes to the wrong place. I found no caller in core that relies on it. Encoded relative URLs keep working. -
Wolfgang Klinger commented on patch set 1 10/08/26, 13:53
Claude Opus looked where the absolute returnUrl comes from: Filelist.getReturnUrl() in file-list.ts uses form.action, and the DOM property always returns the absolute URL, even though the attribute is relative. That came in with #106352. The context menu "Edit metadata" still sends a relative URL, which might be why it couldn't be reproduced before. With this patch, folders with spaces in the name (e.g. created via FTP) still fail the same way, because only non-ASCII bytes are re-encoded. Maybe simpler: make the JS send a relative URL again, like the context menu does: const formAction = new URL(form.action); returnUrl = formAction.pathname + formAction.search; Relative URLs already pass sanitizeLocalUrl() with umlauts and spaces, so this would fix both cases without touching GeneralUtility. -
Georg Ringer uploaded patch set 2
CR +1V +110/09/26, 18:03 -
core-ci voted on patch set 2 V +1 10/09/26, 18:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110671
-
Benni Mack commented on patch set 2 10/09/26, 19:49
Reply
Done -
Wouter Wolters voted on patch set 2 CR +1 V +1 10/09/26, 20:01
-
Benni Mack voted on patch set 2 CR +1 V +1 10/10/26, 06:31
-
Georg Ringer commented on patch set 2 11/03/26, 19:38
Reply
Done -
Georg Ringer uploaded patch set 3
CR +1V +111/09/26, 20:48 -
Benni Mack voted on patch set 3 CR +1 V +1 11/09/26, 20:49
-
core-ci voted on patch set 3 V +1 11/09/26, 21:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113786
-
Simon Schaufelberger voted on patch set 3 CR +1 V +1 11/14/26, 20:34