]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Fix undefined symbol name in webui. 1858/head
authorGaëtan Duchaussois <gaetan-github@pignouf.fr>
Tue, 10 Oct 2017 07:50:24 +0000 (09:50 +0200)
committerGitHub <noreply@github.com>
Tue, 10 Oct 2017 07:50:24 +0000 (09:50 +0200)
The EscapeHTML function called with undefined value return "undefined" as string. This PR avoid giving undefined value to sym.name

interface/js/app/history.js

index b13b3007b55131965333994c7778e5517a961604..422b8aa3b24bb03996621e4be56bf2ebbbbd5f3d 100644 (file)
@@ -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) {