[pve-devel] [PATCH manager 4/6] Remove useless escapes

Dominic Jäger d.jaeger at proxmox.com
Tue May 18 14:12:16 CEST 2021


Signed-off-by: Dominic Jäger <d.jaeger at proxmox.com>
---
 www/manager6/lxc/DNS.js        | 2 +-
 www/manager6/qemu/CloudInit.js | 2 +-
 www/manager6/qemu/USBEdit.js   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index f277370c..6c519023 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -13,7 +13,7 @@ Ext.define('PVE.lxc.DNSInputPanel', {
 	}
 
 	if (values.nameserver) {
-	    var list = values.nameserver.split(/[\ \,\;]+/);
+	    let list = values.nameserver.split(/[ ,;]+/);
 	    values.nameserver = list.join(' ');
 	} else if (!me.insideWizard) {
 	    deletes.push('nameserver');
diff --git a/www/manager6/qemu/CloudInit.js b/www/manager6/qemu/CloudInit.js
index 8465b402..77ff93d4 100644
--- a/www/manager6/qemu/CloudInit.js
+++ b/www/manager6/qemu/CloudInit.js
@@ -86,7 +86,7 @@ Ext.define('PVE.qemu.CloudInit', {
 		var insert_params = {};
 		let disk = PVE.Parser.parseQemuDrive(view.ciDriveId, view.ciDrive);
 		var storage = '';
-		var stormatch = disk.file.match(/^([^\:]+)\:/);
+		var stormatch = disk.file.match(/^([^:]+):/);
 		if (stormatch) {
 		    storage = stormatch[1];
 		}
diff --git a/www/manager6/qemu/USBEdit.js b/www/manager6/qemu/USBEdit.js
index 6a8b93bd..a2204584 100644
--- a/www/manager6/qemu/USBEdit.js
+++ b/www/manager6/qemu/USBEdit.js
@@ -149,11 +149,11 @@ Ext.define('PVE.qemu.USBEdit', {
 		var type = 'spice';
 
 		for (let i = 0; i < data.length; i++) {
-		    if (/^(host=)?(0x)?[a-zA-Z0-9]{4}\:(0x)?[a-zA-Z0-9]{4}$/.test(data[i])) {
+		    if (/^(host=)?(0x)?[a-zA-Z0-9]{4}:(0x)?[a-zA-Z0-9]{4}$/.test(data[i])) {
 			hostdevice = data[i];
 			hostdevice = hostdevice.replace('host=', '').replace('0x', '');
 			type = 'hostdevice';
-		    } else if (/^(host=)?(\d+)\-(\d+(\.\d+)*)$/.test(data[i])) {
+		    } else if (/^(host=)?(\d+)-(\d+(\.\d+)*)$/.test(data[i])) {
 			port = data[i];
 			port = port.replace('host=', '');
 			type = 'port';
-- 
2.20.1






More information about the pve-devel mailing list