Skip to content

Commit 4ed4a35

Browse files
authored
IBX-11775: [JS] Fixed escaping content name in sub-items list
For more details see https://ibexa.atlassian.net/browse/IBX-11775 Key changes: * [JS] Fixed escaping content name in sub-items list
1 parent 2590ae7 commit 4ed4a35

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/bundle/Resources/public/js/scripts/admin.trash.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(function (global, doc, Translator) {
1+
(function (global, doc, ibexa, Translator) {
22
const form = doc.querySelector('form[name="location_trash"]');
33
const submitButton = form.querySelector('button[type="submit"]');
44
const allOptions = form.querySelectorAll('.ibexa-modal__trash-option');
@@ -12,6 +12,7 @@
1212
button.classList.add('disabled');
1313
};
1414
const refreshTrashModal = (event) => {
15+
const { escapeHTML } = ibexa.helpers.text;
1516
const { numberOfSubitems } = event.detail;
1617
const sendToTrashModal = document.querySelector('.ibexa-modal--trash-location');
1718
const modalBody = sendToTrashModal.querySelector('.modal-body');
@@ -22,7 +23,7 @@
2223
const message = Translator.trans(
2324
/*@Desc("Sending '%content%' and its %children_count% Content item(s) to Trash will also send the sub-items of this Location to Trash.")*/ 'trash_container.modal.message_main',
2425
{
25-
content: contentName,
26+
content: escapeHTML(contentName),
2627
children_count: numberOfSubitems,
2728
},
2829
'ibexa_content',
@@ -62,4 +63,4 @@
6263
};
6364

6465
form.addEventListener('change', toggleSubmitButton, false);
65-
})(window, window.document, window.Translator);
66+
})(window, window.document, window.ibexa, window.Translator);

0 commit comments

Comments
 (0)