ui: add some missing htmlEncodes

Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
Friedrich Weber 2023-07-25 13:52:46 +02:00 committed by Thomas Lamprecht
parent c34c541820
commit 98cbec545f
7 changed files with 13 additions and 7 deletions

View File

@ -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) {

View File

@ -249,6 +249,7 @@ Ext.define('PVE.dc.BackupInfo', {
xtype: 'displayfield',
name: 'comment',
fieldLabel: gettext('Comment'),
renderer: Ext.String.htmlEncode,
},
{
xtype: 'fieldset',

View File

@ -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,
},

View File

@ -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,
},

View File

@ -40,6 +40,7 @@ Ext.define('PVE.form.PCIMapSelector', {
header: gettext('Description'),
dataIndex: 'description',
flex: 1,
renderer: Ext.String.htmlEncode,
},
{
header: gettext('Status'),

View File

@ -64,6 +64,7 @@ Ext.define('PVE.form.USBMapSelector', {
header: gettext('Comment'),
dataIndex: 'description',
flex: 1,
renderer: Ext.String.htmlEncode,
},
],
},

View File

@ -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: {