From: Leo Nunner <l.nunner@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-gui] gui: properly encode rule names in overview
Date: Tue, 28 Mar 2023 14:08:21 +0200 [thread overview]
Message-ID: <20230328120821.107090-1-l.nunner@proxmox.com> (raw)
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>
---
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}',
--
2.30.2
next reply other threads:[~2023-03-28 12:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 12:08 Leo Nunner [this message]
2023-05-17 10:04 ` [pmg-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230328120821.107090-1-l.nunner@proxmox.com \
--to=l.nunner@proxmox.com \
--cc=pmg-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox