summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/pkgsubmit.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/js/pkgsubmit.js b/js/pkgsubmit.js
index bbd71ba..3bcfb46 100644
--- a/js/pkgsubmit.js
+++ b/js/pkgsubmit.js
@@ -126,6 +126,13 @@ function build_log_files_list(ev) {
}
/**
+ * See http://jsperf.com/encode-html-entities
+*/
+function safe_tags_regex(str) {
+ return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+}
+
+/**
*/
function show_log_file(ev) {
@@ -157,7 +164,7 @@ function show_log_file(ev) {
"/" + $(this).attr("href"),
{},
function (data) {
- $("#" + elId).html(highlight_text(data))
+ $("#" + elId).html(highlight_text(safe_tags_regex(data)))
.before(
$("<div />", {
class: "controls"