From df2a647a7263efb667d801c3547883bcc72951df Mon Sep 17 00:00:00 2001 From: Leo Nunner Date: Tue, 28 Mar 2023 14:08:21 +0200 Subject: [PATCH] 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 [ T: rework commit message a bit (mostly subject) ] Signed-off-by: Thomas Lamprecht --- js/RuleConfiguration.js | 1 + js/RuleInfo.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/RuleConfiguration.js b/js/RuleConfiguration.js index 859a3d9..1209b1d 100644 --- a/js/RuleConfiguration.js +++ b/js/RuleConfiguration.js @@ -216,6 +216,7 @@ Ext.define('PMG.RulesConfiguration', { text: 'Name', dataIndex: 'name', flex: 1, + renderer: Ext.htmlEncode, }, { text: 'Priority', diff --git a/js/RuleInfo.js b/js/RuleInfo.js index b7802fa..8f39695 100644 --- a/js/RuleInfo.js +++ b/js/RuleInfo.js @@ -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}',