summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-01-27 19:20:42 +0000
committerErmal Luçi <eri@pfsense.org>2008-01-27 19:20:42 +0000
commiteaa372599b29d34d4f2443922020fbb8e82c4008 (patch)
tree5c73df2f504fbc5c5dcc96172792fe9f9a4c7e0c /etc
parent56f9c164e2d60a3ae624d8c545b7a1c7a450c41b (diff)
downloadpfsense-eaa372599b29d34d4f2443922020fbb8e82c4008.zip
pfsense-eaa372599b29d34d4f2443922020fbb8e82c4008.tar.gz
Change regex to match valid bandwidth to allow bandwidth with decimal point to be specified.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/util.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc
index 7c46eac..33cb2b1 100644
--- a/etc/inc/util.inc
+++ b/etc/inc/util.inc
@@ -244,7 +244,7 @@ function is_portrange($portrange) {
/* returns true if $val is a valid shaper bandwidth value */
function is_valid_shaperbw($val) {
- return (preg_match("/^[0-9]+(Kb|Mb|Gb|%)$/", $val));
+ return (preg_match("/^(\d+(?:\.\d+)?)([MKG]?b|%)$/", $val));
}
/*
@@ -574,4 +574,4 @@ function resolve_retry($hostname, $retries = 5) {
return false;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud