Improve IP detection regex so it isn't fooled by domains that

look like IP addresses.
This commit is contained in:
Lucas Wilson-Richter
2014-03-12 07:47:21 +11:00
parent 3fcc49ff00
commit 69c13f1bd3

View File

@@ -104,7 +104,7 @@ __END__
});
}
function update() {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/(\d{1,3}\.){3}\d{1,3}/)) {
if ($("#vhost").is(":checked") && $("#hostname").val().match(/^(\d{1,3}\.){3}\d{1,3}$/)) {
alert("In order to use virtualhost naming, the hostname must not be an IP but a valid domain name.")
$("#vhost").prop('checked', false);
}