Skip to content

Commit

Permalink
[BUGFIX] Properly encode context menu URL parameters
Browse files Browse the repository at this point in the history
Especially the "uid" might contain special characters as
it holds the combined identifier in case of e.g. folders.
Encoding this value is therefore necessary to prevent
JS errors on executing the corresponding AJAX request.

Resolves: #99893
Releases: main, 11.5
Change-Id: I6f00a23a34497b65f2ed915f76f1e40b3699792a
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77884
Tested-by: core-ci <typo3@b13.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
  • Loading branch information
o-ba committed Feb 16, 2023
1 parent 97706f2 commit 74d2ab6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ class ContextMenu {
parameters += 'table=' + encodeURIComponent(table);
}
if (typeof uid !== 'undefined') {
parameters += (parameters.length > 0 ? '&' : '') + 'uid=' + uid;
parameters += (parameters.length > 0 ? '&' : '') + 'uid=' + (typeof uid === 'number' ? uid : encodeURIComponent(uid));
}
if (typeof context !== 'undefined') {
parameters += (parameters.length > 0 ? '&' : '') + 'context=' + context;
parameters += (parameters.length > 0 ? '&' : '') + 'context=' + encodeURIComponent(context);
}
if (typeof enDisItems !== 'undefined') {
parameters += (parameters.length > 0 ? '&' : '') + 'enDisItems=' + enDisItems;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 74d2ab6

Please sign in to comment.