[pve-devel] [PATCH manager 1/2] fix #1910: uriescape username when using in url

Dominik Csapak d.csapak at proxmox.com
Fri Sep 14 15:40:21 CEST 2018


encodeURI does not escape '#' so we have to do this manually

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/UserEdit.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/www/manager6/dc/UserEdit.js b/www/manager6/dc/UserEdit.js
index 66950435..8077030a 100644
--- a/www/manager6/dc/UserEdit.js
+++ b/www/manager6/dc/UserEdit.js
@@ -17,7 +17,8 @@ Ext.define('PVE.dc.UserEdit', {
             url = '/api2/extjs/access/users';
             method = 'POST';
         } else {
-            url = '/api2/extjs/access/users/' + me.userid;
+	    url = '/api2/extjs/access/users/' + encodeURI(me.userid);
+	    url = url.replace(/#/g, '%23');
             method = 'PUT';
 	}
 
-- 
2.11.0




More information about the pve-devel mailing list