From 2fb669485897c0033afde56d0ac4cc37dbf13494 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 21 Oct 2014 00:40:22 -0500 Subject: hostnames can end with a . (and actually always do, it's just usually implied), so allow that here. Fixes wrong input validation in parts of nsupdate GUI, among other things. --- etc/inc/util.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/inc/util.inc b/etc/inc/util.inc index a9e533f..c3ec285 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -644,7 +644,7 @@ function is_domain($domain) { if (!is_string($domain)) return false; - if (preg_match('/^(?:(?:[a-z_0-9]|[a-z_0-9][a-z_0-9\-]*[a-z_0-9])\.)*(?:[a-z_0-9]|[a-z_0-9][a-z_0-9\-]*[a-z_0-9])$/i', $domain)) + if (preg_match('/^(?:(?:[a-z_0-9]|[a-z_0-9][a-z_0-9\-]*[a-z_0-9])\.)*(?:[a-z_0-9]|[a-z_0-9][a-z_0-9\-]*[a-z_0-9\.])$/i', $domain)) return true; else return false; -- cgit v1.1