aboutsummaryrefslogtreecommitdiffstats
path: root/interface/js
diff options
context:
space:
mode:
authorAndré Peters <andryyy@users.noreply.github.com>2017-07-08 22:56:21 +0200
committerGitHub <noreply@github.com>2017-07-08 22:56:21 +0200
commitb19560aa3fed3084fc7d37e91cd86c0fa0d96917 (patch)
tree437429bcb299a27c8fcc23f99eab0caeb3444e53 /interface/js
parent08c88c0e020987316a9acf761827ab268237e041 (diff)
downloadrspamd-b19560aa3fed3084fc7d37e91cd86c0fa0d96917.tar.gz
rspamd-b19560aa3fed3084fc7d37e91cd86c0fa0d96917.zip
Escape HTML in cells by using underscores escaper
Diffstat (limited to 'interface/js')
-rw-r--r--interface/js/app/history.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/interface/js/app/history.js b/interface/js/app/history.js
index 3e8010de4..02c393011 100644
--- a/interface/js/app/history.js
+++ b/interface/js/app/history.js
@@ -26,7 +26,22 @@ define(['jquery', 'footable', 'humanize'],
function($, _, Humanize) {
var interface = {};
var ft = {};
-
+ var htmlEscapes = {
+ '&': '&amp;',
+ '<': '&lt;',
+ '>': '&gt;',
+ '"': '&quot;',
+ "'": '&#x27;',
+ '/': '&#x2F;'
+ };
+ var htmlEscaper = /[&<>"'\/]/g;
+
+ EscapeHTML = function(string) {
+ return ('' + string).replace(htmlEscaper, function(match) {
+ return htmlEscapes[match];
+ });
+ };
+
function unix_time_format(tm) {
var date = new Date(tm ? tm * 1000 : 0);
return date.toLocaleString();
@@ -178,7 +193,8 @@ function($, _, Humanize) {
"font-size": "11px",
"word-break": "break-all",
"minWidth": 150
- }
+ },
+ "formatter": EscapeHTML
}, {
"name": "action",
"title": "Action",