From: Gaƫtan Duchaussois Date: Tue, 10 Oct 2017 07:50:24 +0000 (+0200) Subject: Fix undefined symbol name in webui. X-Git-Tag: 1.7.0~567^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8a35de805200ff0110eae556b1083baae415c8d;p=thirdparty%2Frspamd.git 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 --- diff --git a/interface/js/app/history.js b/interface/js/app/history.js index b13b3007b5..422b8aa3b2 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 = '' + sym.name + '' + "(" + sym.score + ")"; if (sym.options) {