1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Added validate_host()

This commit is contained in:
billz 2020-09-19 22:24:15 +01:00
parent 199f83777b
commit 5189853c19

View File

@ -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);
}