summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-01-29 23:43:17 +0000
committerErmal Luçi <eri@pfsense.org>2008-01-29 23:43:17 +0000
commit079712003cfaf135b5d14ff27ae25afbdc4923e9 (patch)
treeaf6939cbf5f7adfa5dffcac76f7c94c95e703c06 /etc
parent58664cc9fbc39de8273c90ea88330741d1c0eb95 (diff)
downloadpfsense-079712003cfaf135b5d14ff27ae25afbdc4923e9.zip
pfsense-079712003cfaf135b5d14ff27ae25afbdc4923e9.tar.gz
Fix a bug with regex matching.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/shaper.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 6354f8f..88a504b 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -105,12 +105,12 @@ function get_bandwidthtype_scale($type) {
function get_hfsc_bandwidth($object, $bw) {
$pattern= "/[0-9]+/";
if (preg_match($pattern, $bw, $match))
- $bw_1 = $match[0];
+ $bw_1 = $match[1];
else
return 0;
$pattern= "/(b|Kb|Mb|Gb|%)/";
if (preg_match($pattern, $bw, $match)) {
- switch ($match[0]) {
+ switch ($match[1]) {
case '%':
$bw_1 = $bw_1 / 100 * get_interface_bandwidth($object);
break;
OpenPOWER on IntegriCloud