Skip to content

Commit

Permalink
Add missing html elements to sanitizer for finder debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
HLeithner committed Nov 7, 2024
1 parent 30a64b3 commit 27674cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build/media_source/com_finder/js/debug.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
onSuccess: (response) => {
const output = document.getElementById('indexer-output');
const allowedHtml = {
fieldset: [], legend: [], dl: ['class'], dt: ['class'], dd: ['class'],
};
try {
const parsed = JSON.parse(response);
output.innerHTML = Joomla.sanitizeHtml(parsed.rendered);
output.innerHTML = Joomla.sanitizeHtml(parsed.rendered, allowedHtml);
} catch (e) {
output.innerHTML = Joomla.sanitizeHtml(response);
output.innerHTML = Joomla.sanitizeHtml(response, allowedHtml);
}
},
onError: (xhr) => {
Expand Down

0 comments on commit 27674cb

Please sign in to comment.