Skip to content

Commit 7d3e174

Browse files
authored
Signed-off-by: jolheiser <[email protected]> (#14898) (#14899)
1 parent 8456700 commit 7d3e174

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

web_src/js/features/contextpopup.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {htmlEscape} from 'escape-goat';
12
import {svg} from '../svg.js';
23

34
const {AppSubUrl} = window.config;
@@ -31,7 +32,7 @@ function issuePopup(owner, repo, index, $element) {
3132
if ((red * 0.299 + green * 0.587 + blue * 0.114) > 125) {
3233
color = '#000000';
3334
}
34-
labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${label.name}</div>`;
35+
labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${htmlEscape(label.name)}</div>`;
3536
}
3637
if (labels.length > 0) {
3738
labels = `<p>${labels}</p>`;
@@ -64,9 +65,9 @@ function issuePopup(owner, repo, index, $element) {
6465
},
6566
html: `
6667
<div>
67-
<p><small>${issue.repository.full_name} on ${createdAt}</small></p>
68-
<p><span class="${color}">${svg(octicon)}</span> <strong>${issue.title}</strong> #${index}</p>
69-
<p>${body}</p>
68+
<p><small>${htmlEscape(issue.repository.full_name)} on ${createdAt}</small></p>
69+
<p><span class="${color}">${svg(octicon)}</span> <strong>${htmlEscape(issue.title)}</strong> #${index}</p>
70+
<p>${htmlEscape(body)}</p>
7071
${labels}
7172
</div>
7273
`

0 commit comments

Comments
 (0)