mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-31 04:32:06 +08:00
Fix xss for titles in tags labels [SCI-8133] (#5130)
This commit is contained in:
parent
92d7fbb351
commit
946ea47d55
1 changed files with 2 additions and 1 deletions
|
@ -727,16 +727,17 @@ var dropdownSelector = (function() {
|
|||
// Select element appearance
|
||||
var tagAppearance = selector.data('config').selectAppearance === 'simple' ? 'ds-simple' : 'ds-tags';
|
||||
var label = customLabel ? customLabel(data) : data.label;
|
||||
var title = (data.params && data.params.tooltip) || $('<span>' + label + '</span>').text().trim();
|
||||
// Add new tag before search field
|
||||
var tag = $(`<div class="${tagAppearance} ${customClass}" style="${customStyle ? customStyle(data) : ''}" >
|
||||
<div class="tag-label"
|
||||
title="${(data.params && data.params.tooltip) || $('<span>' + label + '</span>').text().trim()}"
|
||||
data-ds-tag-group="${data.group}"
|
||||
data-ds-tag-id="${data.value}">
|
||||
</div>
|
||||
<i class="fas fa-times ${selector.data('config').singleSelect ? 'hidden' : ''}"></i>
|
||||
</div>`).insertBefore(container.find('.input-field .search-field'));
|
||||
|
||||
tag.find('.tag-label').attr('title', title);
|
||||
if (selector.data('config').labelHTML) {
|
||||
tag.find('.tag-label').html(label);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue