public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-gui] gui: properly encode rule names in overview
@ 2023-03-28 12:08 Leo Nunner
  2023-05-17 10:04 ` [pmg-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Leo Nunner @ 2023-03-28 12:08 UTC (permalink / raw)
  To: pmg-devel

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





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-05-17 10:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 12:08 [pmg-devel] [PATCH pmg-gui] gui: properly encode rule names in overview Leo Nunner
2023-05-17 10:04 ` [pmg-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal