Skip to content

Commit

Permalink
[BUGFIX] Apply proper url encoding to query params in form engine popups
Browse files Browse the repository at this point in the history
With #101231 a missing URL encoding in FormEngine was triggered
which caused contents like "svg;disallowed=|irre-object-id" to be
added to bparams which got transformed into "svg&disallowed" in
some setups (ddev, most likely caused by the ddev-router-proxy).

This "change" causes the irre object id to be cut off from the
bparams in IREE file list element browser, which is why "select"
actions on file list elements were silently ignored.

Resolves: #101433
Related: #101231
Releases: main, 12.4, 11.5
Change-Id: I89dd53131f9ecb3b199bbcd2d1abf6be87f819da
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80170
Tested-by: Benjamin Franzke <ben@bnf.dev>
Reviewed-by: Kevin Appelt <kevin.appelt@icloud.com>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Stefan B�rk <stefan@buerk.tech>
Tested-by: Benni Mack <benni@typo3.org>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Jasmina Lie�mann <minapokhalo+typo3@gmail.com>
Tested-by: Stefan B�rk <stefan@buerk.tech>
Reviewed-by: Benjamin Franzke <ben@bnf.dev>
Tested-by: Kevin Appelt <kevin.appelt@icloud.com>
  • Loading branch information
bnf committed Jul 25, 2023
1 parent 1269a1c commit c3ada49
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion Build/Sources/TypeScript/backend/form-engine.ts
Expand Up @@ -136,9 +136,20 @@ export default (function() {
* @param {string} entryPoint the entry point, which should be expanded by default
*/
FormEngine.openPopupWindow = function(mode: string, params: string, entryPoint: string): ModalElement {
const queryParams: {mode: string, bparams: string, expandPage?: string, expandFolder?: string} = {
mode: mode,
bparams: params
};
if (entryPoint) {
if (mode === 'db') {
queryParams.expandPage = entryPoint;
} else {
queryParams.expandFolder = entryPoint;
}
}
return Modal.advanced({
type: Modal.types.iframe,
content: FormEngine.browserUrl + '&mode=' + mode + '&bparams=' + params + (entryPoint ? ('&' + (mode === 'db' ? 'expandPage' : 'expandFolder') + '=' + entryPoint) : ''),
content: FormEngine.browserUrl + '&' + (new URLSearchParams(queryParams)).toString(),
size: Modal.sizes.large
});
};
Expand Down

0 comments on commit c3ada49

Please sign in to comment.