]> source.dussan.org Git - gitea.git/commitdiff
Signed-off-by: jolheiser <john.olheiser@gmail.com> (#14898)
authorJohn Olheiser <john.olheiser@gmail.com>
Fri, 5 Mar 2021 21:00:15 +0000 (15:00 -0600)
committerGitHub <noreply@github.com>
Fri, 5 Mar 2021 21:00:15 +0000 (21:00 +0000)
web_src/js/features/contextpopup.js

index a9a0ceee3b7ebf3ea7683fc3f44c3fbf28d37832..c16820cf1f7404637fa7a60cb4a8861533ebe1cd 100644 (file)
@@ -1,3 +1,4 @@
+import {htmlEscape} from 'escape-goat';
 import {svg} from '../svg.js';
 
 const {AppSubUrl} = window.config;
@@ -31,7 +32,7 @@ function issuePopup(owner, repo, index, $element) {
       if ((red * 0.299 + green * 0.587 + blue * 0.114) > 125) {
         color = '#000000';
       }
-      labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${label.name}</div>`;
+      labels += `<div class="ui label" style="color: ${color}; background-color:#${label.color};">${htmlEscape(label.name)}</div>`;
     }
     if (labels.length > 0) {
       labels = `<p>${labels}</p>`;
@@ -64,9 +65,9 @@ function issuePopup(owner, repo, index, $element) {
       },
       html: `
 <div>
-  <p><small>${issue.repository.full_name} on ${createdAt}</small></p>
-  <p><span class="${color}">${svg(octicon)}</span> <strong>${issue.title}</strong> #${index}</p>
-  <p>${body}</p>
+  <p><small>${htmlEscape(issue.repository.full_name)} on ${createdAt}</small></p>
+  <p><span class="${color}">${svg(octicon)}</span> <strong>${htmlEscape(issue.title)}</strong> #${index}</p>
+  <p>${htmlEscape(body)}</p>
   ${labels}
 </div>
 `