From 3fcc49ff00997d989fa33b7e977602c570980357 Mon Sep 17 00:00:00 2001 From: Lucas Wilson-Richter Date: Sun, 9 Mar 2014 09:43:33 +1100 Subject: [PATCH] Validate vhosts names more strictly There was a bug in the setup page where valid domains that start with a number would be captured by the validation check designed to detect IP addresses. This check detects IPs by comparing the host name to a regex, instead of simply detecting whether the first character is a number. --- contrib/dokku-installer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/dokku-installer.rb b/contrib/dokku-installer.rb index 8ef81b154..0c7a8e25c 100755 --- a/contrib/dokku-installer.rb +++ b/contrib/dokku-installer.rb @@ -104,7 +104,7 @@ __END__ }); } function update() { - if ($("#vhost").is(":checked") && !isNaN($("#hostname").val()[0])) { + 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); }