[pmg-devel] [PATCH pmg-gui 1/2] add missing encodeURIComponent

Dominik Csapak d.csapak at proxmox.com
Tue Feb 19 12:33:01 CET 2019


some data contains special characters that might make problems in urls,
so encode them

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 js/LDAPConfig.js         | 4 ++--
 js/UserBlackWhiteList.js | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/js/LDAPConfig.js b/js/LDAPConfig.js
index 8990847..172a75b 100644
--- a/js/LDAPConfig.js
+++ b/js/LDAPConfig.js
@@ -269,7 +269,7 @@ Ext.define('PMG.LDAPConfig', {
 		items: [{
 		    xtype: 'pmgLDAPUserGrid',
 		    border: false,
-		    url: '/api2/json/config/ldap/' + name + '/groups/' +  record.data.gid
+		    url: '/api2/json/config/ldap/' + name + '/groups/' +  encodeURIComponent(record.data.gid)
 		}]
 	    }).show();
 	},
@@ -297,7 +297,7 @@ Ext.define('PMG.LDAPConfig', {
 			field: ['email', 'primary'],
 			proxy: {
 			    type: 'proxmox',
-			    url: '/api2/json/config/ldap/' + name + '/users/' +  record.data.pmail
+			    url: '/api2/json/config/ldap/' + name + '/users/' +  encodeURIComponent(record.data.pmail)
 			}
 		    },
 		    columns: [
diff --git a/js/UserBlackWhiteList.js b/js/UserBlackWhiteList.js
index 3cc5adb..0e4a96e 100644
--- a/js/UserBlackWhiteList.js
+++ b/js/UserBlackWhiteList.js
@@ -68,7 +68,7 @@ Ext.define('PMG.UserBlackWhiteList', {
 	    }
 
 	    var params = me.getStore().getProxy().getExtraParams() || {};
-	    var url = '/quarantine/' + me.listname + '/' + rec.getId();
+	    var url = '/quarantine/' + me.listname + '/' + encodeURIComponent(rec.getId());
 
 	    Proxmox.Utils.API2Request({
 		url: url + '?' + Ext.Object.toQueryString(params),
-- 
2.11.0




More information about the pmg-devel mailing list