summaryrefslogtreecommitdiffstats
path: root/interface/js
diff options
context:
space:
mode:
authorGaƫtan Duchaussois <gaetan-github@pignouf.fr>2017-10-10 09:50:24 +0200
committerGitHub <noreply@github.com>2017-10-10 09:50:24 +0200
commitd8a35de805200ff0110eae556b1083baae415c8d (patch)
tree013f3c3786b00820b9662f388dddd40ad6df87e0 /interface/js
parent2e2c66f6be03c03de7696918cc222047c70e9747 (diff)
downloadrspamd-d8a35de805200ff0110eae556b1083baae415c8d.tar.gz
rspamd-d8a35de805200ff0110eae556b1083baae415c8d.zip
Fix undefined symbol name in webui.
The EscapeHTML function called with undefined value return "undefined" as string. This PR avoid giving undefined value to sym.name
Diffstat (limited to 'interface/js')
-rw-r--r--interface/js/app/history.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/interface/js/app/history.js b/interface/js/app/history.js
index b13b3007b..422b8aa3b 100644
--- a/interface/js/app/history.js
+++ b/interface/js/app/history.js
@@ -63,7 +63,9 @@ function($, _, Humanize) {
case "symbols":
Object.keys(item.symbols).map(function(key) {
var sym = item.symbols[key];
-
+ if (!sym.name) {
+ sym.name = key;
+ }
sym.name = EscapeHTML(key);
sym.description = EscapeHTML(sym.description);
@@ -117,9 +119,7 @@ function($, _, Humanize) {
preprocess_item(item);
Object.keys(item.symbols).map(function(key) {
var sym = item.symbols[key];
- if (!sym.name) {
- sym.name = key;
- }
+
var str = '<strong>' + sym.name + '</strong>' + "(" + sym.score + ")";
if (sym.options) {