From 5189853c19435a7e70cf7a9cfe756f5f0c7ae260 Mon Sep 17 00:00:00 2001 From: billz Date: Sat, 19 Sep 2020 22:24:15 +0100 Subject: [PATCH] Added validate_host() --- includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/includes/functions.php b/includes/functions.php index 4d299314..1304d61f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -452,3 +452,8 @@ function getBridgedState() return $arrHostapdConf['BridgedEnable']; } +// Validates a host or FQDN +function validate_host($host) { + return preg_match('/^([a-z\d](-*[a-z\d])*)(\.([a-z\d](-*[a-z\d])*))*$/i', $host); +} +