public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s
@ 2023-07-25 11:52 Friedrich Weber
  2023-07-25 11:52 ` [pve-devel] [PATCH widget-toolkit 1/2] " Friedrich Weber
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Friedrich Weber @ 2023-07-25 11:52 UTC (permalink / raw)
  To: pve-devel

These two patches add some `htmlEncode` calls/renderers that
had been missing to proxmox-widget-toolkit and pve-manager.
Each patch can be individually applied.



widget-toolkit:

Friedrich Weber (1):
  ui: add some missing `htmlEncode`s

 src/form/NetworkSelector.js | 1 +
 src/node/APTRepositories.js | 1 +
 2 files changed, 2 insertions(+)


manager:

Friedrich Weber (1):
  ui: add some missing `htmlEncode`s

 www/manager6/Utils.js               | 9 ++++++---
 www/manager6/dc/BackupJobDetail.js  | 1 +
 www/manager6/dc/PCIMapView.js       | 2 +-
 www/manager6/dc/USBMapView.js       | 2 +-
 www/manager6/form/PCIMapSelector.js | 1 +
 www/manager6/form/USBMapSelector.js | 1 +
 www/manager6/qemu/CloudInit.js      | 4 ++--
 7 files changed, 13 insertions(+), 7 deletions(-)


Summary over all repositories:
  9 files changed, 15 insertions(+), 7 deletions(-)

-- 
murpp v0.4.0





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

* [pve-devel] [PATCH widget-toolkit 1/2] ui: add some missing `htmlEncode`s
  2023-07-25 11:52 [pve-devel] [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s Friedrich Weber
@ 2023-07-25 11:52 ` Friedrich Weber
  2023-07-25 11:52 ` [pve-devel] [PATCH manager 2/2] " Friedrich Weber
  2023-07-25 15:00 ` [pve-devel] applied-series: [PATCH widget-toolkit/manager 0/2] " Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Friedrich Weber @ 2023-07-25 11:52 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 src/form/NetworkSelector.js | 1 +
 src/node/APTRepositories.js | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/form/NetworkSelector.js b/src/form/NetworkSelector.js
index 86d394d..ed3a02b 100644
--- a/src/form/NetworkSelector.js
+++ b/src/form/NetworkSelector.js
@@ -123,6 +123,7 @@ Ext.define('Proxmox.form.NetworkSelector', {
 		header: gettext('Comment'),
 		flex: 2,
 		dataIndex: 'comments',
+		renderer: Ext.String.htmlEncode,
 	    },
 	],
     },
diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 53af2c7..4e74da2 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -361,6 +361,7 @@ Ext.define('Proxmox.node.APTRepositoriesGrid', {
 	    header: gettext('Comment'),
 	    dataIndex: 'Comment',
 	    flex: 2,
+	    renderer: Ext.String.htmlEncode,
 	},
     ],
 
-- 
2.39.2





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

* [pve-devel] [PATCH manager 2/2] ui: add some missing `htmlEncode`s
  2023-07-25 11:52 [pve-devel] [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s Friedrich Weber
  2023-07-25 11:52 ` [pve-devel] [PATCH widget-toolkit 1/2] " Friedrich Weber
@ 2023-07-25 11:52 ` Friedrich Weber
  2023-07-25 15:00 ` [pve-devel] applied-series: [PATCH widget-toolkit/manager 0/2] " Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Friedrich Weber @ 2023-07-25 11:52 UTC (permalink / raw)
  To: pve-devel

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
---
 www/manager6/Utils.js               | 9 ++++++---
 www/manager6/dc/BackupJobDetail.js  | 1 +
 www/manager6/dc/PCIMapView.js       | 2 +-
 www/manager6/dc/USBMapView.js       | 2 +-
 www/manager6/form/PCIMapSelector.js | 1 +
 www/manager6/form/USBMapSelector.js | 1 +
 www/manager6/qemu/CloudInit.js      | 4 ++--
 7 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index a150e848..4e094213 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -1003,15 +1003,18 @@ Ext.define('PVE.Utils', {
     },
 
     render_storage_content: function(value, metaData, record) {
-	var data = record.data;
+	let data = record.data;
+	let result;
 	if (Ext.isNumber(data.channel) &&
 	    Ext.isNumber(data.id) &&
 	    Ext.isNumber(data.lun)) {
-	    return "CH " +
+	    result = "CH " +
 		Ext.String.leftPad(data.channel, 2, '0') +
 		" ID " + data.id + " LUN " + data.lun;
+	} else {
+	    result = data.volid.replace(/^.*?:(.*?\/)?/, '');
 	}
-	return data.volid.replace(/^.*?:(.*?\/)?/, '');
+	return Ext.String.htmlEncode(result);
     },
 
     render_serverity: function(value) {
diff --git a/www/manager6/dc/BackupJobDetail.js b/www/manager6/dc/BackupJobDetail.js
index c4683a47..880784a2 100644
--- a/www/manager6/dc/BackupJobDetail.js
+++ b/www/manager6/dc/BackupJobDetail.js
@@ -249,6 +249,7 @@ Ext.define('PVE.dc.BackupInfo', {
 	    xtype: 'displayfield',
 	    name: 'comment',
 	    fieldLabel: gettext('Comment'),
+	    renderer: Ext.String.htmlEncode,
 	},
 	{
 	    xtype: 'fieldset',
diff --git a/www/manager6/dc/PCIMapView.js b/www/manager6/dc/PCIMapView.js
index 859ef58f..80fe3c0f 100644
--- a/www/manager6/dc/PCIMapView.js
+++ b/www/manager6/dc/PCIMapView.js
@@ -98,7 +98,7 @@ Ext.define('PVE.dc.PCIMapView', {
 	    header: gettext('Comment'),
 	    dataIndex: 'description',
 	    renderer: function(value, _meta, record) {
-		return value ?? record.data.comment;
+		return Ext.String.htmlEncode(value ?? record.data.comment);
 	    },
 	    flex: 1,
 	},
diff --git a/www/manager6/dc/USBMapView.js b/www/manager6/dc/USBMapView.js
index 953e2425..96edc587 100644
--- a/www/manager6/dc/USBMapView.js
+++ b/www/manager6/dc/USBMapView.js
@@ -90,7 +90,7 @@ Ext.define('PVE.dc.USBMapView', {
 	    header: gettext('Comment'),
 	    dataIndex: 'description',
 	    renderer: function(value, _meta, record) {
-		return value ?? record.data.comment;
+		return Ext.String.htmlEncode(value ?? record.data.comment);
 	    },
 	    flex: 1,
 	},
diff --git a/www/manager6/form/PCIMapSelector.js b/www/manager6/form/PCIMapSelector.js
index 1bc73ec0..49629bc2 100644
--- a/www/manager6/form/PCIMapSelector.js
+++ b/www/manager6/form/PCIMapSelector.js
@@ -40,6 +40,7 @@ Ext.define('PVE.form.PCIMapSelector', {
 		header: gettext('Description'),
 		dataIndex: 'description',
 		flex: 1,
+		renderer: Ext.String.htmlEncode,
 	    },
 	    {
 		header: gettext('Status'),
diff --git a/www/manager6/form/USBMapSelector.js b/www/manager6/form/USBMapSelector.js
index 6a33754a..2e55c100 100644
--- a/www/manager6/form/USBMapSelector.js
+++ b/www/manager6/form/USBMapSelector.js
@@ -64,6 +64,7 @@ Ext.define('PVE.form.USBMapSelector', {
 		header: gettext('Comment'),
 		dataIndex: 'description',
 		flex: 1,
+		renderer: Ext.String.htmlEncode,
 	    },
 	],
     },
diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index 03d06d9c..49519726 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -214,7 +214,7 @@ Ext.define('PVE.qemu.CloudInit', {
 		    ],
 		} : undefined,
 		renderer: function(value) {
-		    return value || Proxmox.Utils.defaultText;
+		    return Ext.String.htmlEncode(value || Proxmox.Utils.defaultText);
 		},
 	    },
 	    cipassword: {
@@ -236,7 +236,7 @@ Ext.define('PVE.qemu.CloudInit', {
 		    ],
 		} : undefined,
 		renderer: function(value) {
-		    return value || Proxmox.Utils.noneText;
+		    return Ext.String.htmlEncode(value || Proxmox.Utils.noneText);
 		},
 	    },
 	    searchdomain: {
-- 
2.39.2





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

* [pve-devel] applied-series: [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s
  2023-07-25 11:52 [pve-devel] [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s Friedrich Weber
  2023-07-25 11:52 ` [pve-devel] [PATCH widget-toolkit 1/2] " Friedrich Weber
  2023-07-25 11:52 ` [pve-devel] [PATCH manager 2/2] " Friedrich Weber
@ 2023-07-25 15:00 ` Thomas Lamprecht
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2023-07-25 15:00 UTC (permalink / raw)
  To: Proxmox VE development discussion, Friedrich Weber

On 25/07/2023 13:52, Friedrich Weber wrote:
> These two patches add some `htmlEncode` calls/renderers that
> had been missing to proxmox-widget-toolkit and pve-manager.
> Each patch can be individually applied.
> 
> 
> 
> widget-toolkit:
> 
> Friedrich Weber (1):
>   ui: add some missing `htmlEncode`s
> 
>  src/form/NetworkSelector.js | 1 +
>  src/node/APTRepositories.js | 1 +
>  2 files changed, 2 insertions(+)
> 
> 
> manager:
> 
> Friedrich Weber (1):
>   ui: add some missing `htmlEncode`s
> 
>  www/manager6/Utils.js               | 9 ++++++---
>  www/manager6/dc/BackupJobDetail.js  | 1 +
>  www/manager6/dc/PCIMapView.js       | 2 +-
>  www/manager6/dc/USBMapView.js       | 2 +-
>  www/manager6/form/PCIMapSelector.js | 1 +
>  www/manager6/form/USBMapSelector.js | 1 +
>  www/manager6/qemu/CloudInit.js      | 4 ++--
>  7 files changed, 13 insertions(+), 7 deletions(-)
> 
> 
> Summary over all repositories:
>   9 files changed, 15 insertions(+), 7 deletions(-)
> 


applied series, thanks!




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

end of thread, other threads:[~2023-07-25 15:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-25 11:52 [pve-devel] [PATCH widget-toolkit/manager 0/2] ui: add some missing `htmlEncode`s Friedrich Weber
2023-07-25 11:52 ` [pve-devel] [PATCH widget-toolkit 1/2] " Friedrich Weber
2023-07-25 11:52 ` [pve-devel] [PATCH manager 2/2] " Friedrich Weber
2023-07-25 15:00 ` [pve-devel] applied-series: [PATCH widget-toolkit/manager 0/2] " 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