summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2007-09-25 20:50:18 +0000
committerSeth Mos <seth.mos@xs4all.nl>2007-09-25 20:50:18 +0000
commit5ed54b93ee8dac2a0499bc9acaca90839d17e51a (patch)
tree1480b06af3b62d954e01ff9f1c95711ce5656ead /etc
parent80717709dec31e3dcb45b6a8c180bd0009c92597 (diff)
downloadpfsense-5ed54b93ee8dac2a0499bc9acaca90839d17e51a.zip
pfsense-5ed54b93ee8dac2a0499bc9acaca90839d17e51a.tar.gz
Add function is_fqdn()
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/pfsense-utils.inc16
1 files changed, 15 insertions, 1 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 3559c0b..c3e9652 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -3717,4 +3717,18 @@ function find_dns_aliases() {
}
}
-?> \ No newline at end of file
+function is_fqdn($fqdn) {
+ $hostname = false;
+ if(preg_match("/[-A-Z0-9\.]+\.[-A-Z0-9\.]+/i", $fqdn)) {
+ $hostname = true;
+ }
+ if(preg_match("/\.\./", $fqdn)) {
+ $hostname = false;
+ }
+ if(preg_match("/^\./i", $fqdn)) {
+ $hostname = false;
+ }
+ return($hostname);
+}
+
+?>
OpenPOWER on IntegriCloud