utils: safe id regex: do not allow backslashes
The comment says the regex is the same as SAFE_ID_REGEX in proxmox-schema, but the character class has an additional backslash. It was there since the regex was added, as '\\-' in a regex literal matches a backslash and a hyphen, and the reordering for the linter kept it. So the UI accepts a webhook endpoint name like 'a\b', which the API then rejects as it does not match the schema. Drop the backslash, so that the field shows the name as invalid right away. Signed-off-by: Michal Fox <me@dualfroz.com>
This commit is contained in:
1 parent
7454b8fd4d
commit
3d92bbd515
1 file changed
+1
-1
+1
-1
@@ -1754,7 +1754,7 @@ Ext.define('Proxmox.Utils', {
|
||||
me.httpUrlRegex = new RegExp(HTTP_URL_REGEX);
|
||||
|
||||
// Same as SAFE_ID_REGEX in proxmox-schema
|
||||
me.safeIdRegex = /^(?:[A-Za-z0-9_][A-Za-z0-9._\-\\]*)$/;
|
||||
me.safeIdRegex = /^(?:[A-Za-z0-9_][A-Za-z0-9._-]*)$/;
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user