From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 1231792067 for ; Tue, 28 Mar 2023 14:08:51 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E66941B687 for ; Tue, 28 Mar 2023 14:08:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 28 Mar 2023 14:08:50 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 489E147096 for ; Tue, 28 Mar 2023 14:08:50 +0200 (CEST) From: Leo Nunner To: pmg-devel@lists.proxmox.com Date: Tue, 28 Mar 2023 14:08:21 +0200 Message-Id: <20230328120821.107090-1-l.nunner@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.138 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pmg-devel] [PATCH pmg-gui] gui: properly encode rule names in overview X-BeenThere: pmg-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Mail Gateway development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2023 12:08:51 -0000 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 --- 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