fix #4874: improve error message for invalid hostname

Current error message is not correct because having underscores in
domain names are perfectly valid, although it's not acceptable at host
names, so it should be changed to "This is not a valid hostname".

https://www.ietf.org/rfc/rfc1123.txt section 2.1 "Host Names and Numbers"
https://www.rfc-editor.org/rfc/rfc2181#section-11

Signed-off-by: Amin Vakil <info@aminvakil.com>
 [TL: s/Host /host/ once more, reflow msg with 70cc & reword subject]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Amin Vakil 2023-08-03 04:34:13 +03:30 committed by Thomas Lamprecht
parent e61ffdd6ee
commit 2d613cac1f

View File

@ -129,12 +129,12 @@ Ext.apply(Ext.form.field.VTypes, {
DnsName: function(v) { DnsName: function(v) {
return Proxmox.Utils.DnsName_match.test(v); return Proxmox.Utils.DnsName_match.test(v);
}, },
DnsNameText: gettext('This is not a valid DNS name'), DnsNameText: gettext('This is not a valid hostname'),
DnsNameOrWildcard: function(v) { DnsNameOrWildcard: function(v) {
return Proxmox.Utils.DnsName_or_Wildcard_match.test(v); return Proxmox.Utils.DnsName_or_Wildcard_match.test(v);
}, },
DnsNameOrWildcardText: gettext('This is not a valid DNS name'), DnsNameOrWildcardText: gettext('This is not a valid hostname'),
// email regex used by pve-common // email regex used by pve-common
proxmoxMail: function(v) { proxmoxMail: function(v) {