]> source.dussan.org Git - rspamd.git/commitdiff
[WebUI] Escape HTML characters in errors history 4913/head
authormoisseev <moiseev@mezonplus.ru>
Tue, 9 Apr 2024 06:14:07 +0000 (09:14 +0300)
committermoisseev <moiseev@mezonplus.ru>
Tue, 9 Apr 2024 06:14:07 +0000 (09:14 +0300)
interface/js/app/history.js
interface/js/app/libft.js

index 6366f672388da89d771152aeb5ba0ce1295ab223..18592208733d90cec9aa2be863cedb00f633503b 100644 (file)
@@ -262,6 +262,10 @@ define(["jquery", "app/common", "app/libft", "footable"],
                                 sortValue: item.ts
                             }
                         };
+                        for (const prop in item) {
+                            if (!{}.hasOwnProperty.call(item, prop)) continue;
+                            if (typeof item[prop] === "string") item[prop] = common.escapeHTML(item[prop]);
+                        }
                     });
                     if (Object.prototype.hasOwnProperty.call(common.tables, "errors")) {
                         common.tables.errors.rows.load(rows);
index e45a1718d56a7fd98f3ffda1751c5bd529304b85..1e81cfd26e08852bd43eb17405818ccd7b6e9b8e 100644 (file)
@@ -491,9 +491,7 @@ define(["jquery", "app/common", "footable"],
                         });
                         break;
                     default:
-                        if (typeof item[prop] === "string") {
-                            item[prop] = common.escapeHTML(item[prop]);
-                        }
+                        if (typeof item[prop] === "string") item[prop] = common.escapeHTML(item[prop]);
                 }
             }