From 2f1c52583a547981e04b4beaf329de6c04e4f12b Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Mon, 29 Jun 2020 19:39:13 +0200 Subject: [PATCH] Fixed validdomain() Signed-off-by: Janos SUTO --- webui/system/misc.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/webui/system/misc.php b/webui/system/misc.php index d7caf036..0b516085 100644 --- a/webui/system/misc.php +++ b/webui/system/misc.php @@ -168,11 +168,7 @@ function checkdomain($domain, $domains) { function validdomain($domain = '') { - if($domain == '') { return 0; } - - if(preg_match("/@local$/", $domain)) { return 1; } - - if(preg_match('/@?[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z]{2,10})$/', $domain)) { + if(preg_match("/@?local$/", $domain) || preg_match('/^[a-zA-Z0-9]+[a-zA-Z0-9-_\.]{0,}\.[a-zA-Z0-9]{2,10}$/', $domain)) { return 1; }