mail filter: properly html-encode rule names

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>
This commit is contained in:
Leo Nunner 2023-03-28 14:08:21 +02:00 committed by Thomas Lamprecht
parent 0b525fba79
commit df2a647a72
2 changed files with 2 additions and 2 deletions

View File

@ -216,6 +216,7 @@ Ext.define('PMG.RulesConfiguration', {
text: 'Name',
dataIndex: 'name',
flex: 1,
renderer: Ext.htmlEncode,
},
{
text: 'Priority',

View 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}',