]> git.proxmox.com Git - pmg-gui.git/commitdiff
mail filter: properly html-encode rule names
authorLeo Nunner <l.nunner@proxmox.com>
Tue, 28 Mar 2023 12:08:21 +0000 (14:08 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 17 May 2023 10:01:35 +0000 (12:01 +0200)
Rule names were not HTML-encoded in the rule overview. While some
encoding did happen, it was only on the first load for the info panel
on the right hand side, which was overriden as soon as the edit
window was opened/closed again.

The variable binding now gets HTML-encoded automatically, and the
renderer for rule names has been set to Ext.htmlEncode.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
 [ T: rework commit message a bit (mostly subject) ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
js/RuleConfiguration.js
js/RuleInfo.js

index 859a3d96f43e4019a582f1988ee94e60ce945932..1209b1d587a86fefc5517e043d86790caf04a53b 100644 (file)
@@ -216,6 +216,7 @@ Ext.define('PMG.RulesConfiguration', {
                    text: 'Name',
                    dataIndex: 'name',
                    flex: 1,
+                   renderer: Ext.htmlEncode,
                },
                {
                    text: 'Priority',
index b7802fa261cc0075ad917bda70037b402b58b0b6..8f39695b774724d7a38d754d8217faedf34c0a22 100644 (file)
@@ -86,7 +86,6 @@ Ext.define('PMG.RuleInfo', {
                viewmodel.set('selectedRule', null);
                viewmodel.get('objects').setData([]);
            } else {
-               ruledata.name = Ext.String.htmlEncode(ruledata.name);
                viewmodel.set('selectedRule', ruledata);
 
                var data = [];
@@ -234,7 +233,7 @@ Ext.define('PMG.RuleInfo', {
            },
            bind: {
                data: {
-                   name: '{selectedRule.name}',
+                   name: '{selectedRule.name:htmlEncode}',
                    priority: '{selectedRule.priority}',
                    active: '{selectedRule.active}',
                    direction: '{selectedRule.direction}',