Commit 6f2554dc authored by Gabe Troyan's avatar Gabe Troyan Committed by Oliver Hader
Browse files

[SECURITY] Ensure text preview of multivalue items in form editor

Multivalue items in the form editor user interface were previewed
as HTML, but should be treated as scalar text only.

Resolves: #96743
Releases: main, 11.5, 10.4
Change-Id: I5e8dab26119490ecf19ac5d48c2bc7a5a00daaad
Security-Bulletin: TYPO3-CORE-SA-2022-003
Security-References: CVE-2022-31048
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73297

Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent c93ea692
...@@ -513,10 +513,10 @@ function factory($, Helper, Icons) { ...@@ -513,10 +513,10 @@ function factory($, Helper, Icons) {
*/ */
function setStageHeadline(title) { function setStageHeadline(title) {
if (getUtility().isUndefinedOrNull(title)) { if (getUtility().isUndefinedOrNull(title)) {
title = buildTitleByFormElement(); title = buildTitleByFormElement().text();
} }
$(getHelper().getDomElementDataIdentifierSelector('stageHeadline')).html(title); $(getHelper().getDomElementDataIdentifierSelector('stageHeadline')).text(title);
}; };
/** /**
...@@ -981,10 +981,10 @@ function factory($, Helper, Icons) { ...@@ -981,10 +981,10 @@ function factory($, Helper, Icons) {
getHelper() getHelper()
.getTemplatePropertyDomElement('_type', template) .getTemplatePropertyDomElement('_type', template)
.append(getFormElementDefinition(formElement, 'label')); .append(document.createTextNode(getFormElementDefinition(formElement, 'label')));
getHelper() getHelper()
.getTemplatePropertyDomElement('_identifier', template) .getTemplatePropertyDomElement('_identifier', template)
.append(formElement.get('identifier')); .append(document.createTextNode(formElement.get('identifier')));
}; };
/** /**
...@@ -1029,7 +1029,7 @@ function factory($, Helper, Icons) { ...@@ -1029,7 +1029,7 @@ function factory($, Helper, Icons) {
getHelper() getHelper()
.getTemplatePropertyDomElement('_label', rowTemplate) .getTemplatePropertyDomElement('_label', rowTemplate)
.append(collectionElementConfiguration['label']); .append(document.createTextNode(collectionElementConfiguration['label']));
$(getHelper().getDomElementDataIdentifierSelector('validatorsContainer'), $(template)) $(getHelper().getDomElementDataIdentifierSelector('validatorsContainer'), $(template))
.append(rowTemplate.html()); .append(rowTemplate.html());
} }
...@@ -1089,7 +1089,7 @@ function factory($, Helper, Icons) { ...@@ -1089,7 +1089,7 @@ function factory($, Helper, Icons) {
} }
} }
getHelper().getTemplatePropertyDomElement('_label', rowTemplate).append(label); getHelper().getTemplatePropertyDomElement('_label', rowTemplate).append(document.createTextNode(label));
if (isPreselected) { if (isPreselected) {
getHelper().getTemplatePropertyDomElement('_label', rowTemplate).addClass( getHelper().getTemplatePropertyDomElement('_label', rowTemplate).addClass(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment