summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorBill Marquette <billm@pfsense.org>2005-09-07 03:36:46 +0000
committerBill Marquette <billm@pfsense.org>2005-09-07 03:36:46 +0000
commit3caa8aa1014d8728670a1dd328e6a2ee1bcb7f18 (patch)
treee31dedcc5a055619e83b5e18463333191bc02217 /etc
parent3311566f6c54ddaec13c9d0eac26b648a34dce8d (diff)
downloadpfsense-3caa8aa1014d8728670a1dd328e6a2ee1bcb7f18.zip
pfsense-3caa8aa1014d8728670a1dd328e6a2ee1bcb7f18.tar.gz
Correctly allow a true, false, undef return
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/util.inc16
1 files changed, 13 insertions, 3 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index a84eca7..dbe7d16 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -205,10 +205,20 @@ function is_macaddr($macaddr) {
/* returns true if $name is a valid name for an alias */
function is_validaliasname($name) {
+ /* Array of reserved words */
+
+ if (!preg_match("/[^a-zA-Z0-9]/", $name))
+ return true;
+ else
+ return false;
+}
+
+/* returns true if $name is a valid name for an alias */
+function is_validaliasname($name) {
/* Array of reserved words */
- $reserved = array("port");
- if (in_array($name, $reserved))
- return -2;
+ $reserved = array("port","pass");
+ if (in_array($name, $reserved, true))
+ return;
if (!preg_match("/[^a-zA-Z0-9]/", $name))
return true;
OpenPOWER on IntegriCloud