summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-03-31 17:39:01 +0000
committerErmal <eri@pfsense.org>2011-03-31 17:39:01 +0000
commitd1bd01fffb9f6146af6b5305d450de52d91a9295 (patch)
tree8c69eb395275f25de941bbc2d2a81733cc71fb3d
parentb482254882feff55b6f5c4a7db0ca79042039261 (diff)
downloadpfsense-d1bd01fffb9f6146af6b5305d450de52d91a9295.zip
pfsense-d1bd01fffb9f6146af6b5305d450de52d91a9295.tar.gz
Prevent non-numeric chars from being inputed on bandwidth field.
-rw-r--r--etc/inc/shaper.inc12
1 files changed, 10 insertions, 2 deletions
diff --git a/etc/inc/shaper.inc b/etc/inc/shaper.inc
index 9c8618a..61c61ed 100644
--- a/etc/inc/shaper.inc
+++ b/etc/inc/shaper.inc
@@ -953,9 +953,17 @@ class priq_queue {
$reqdfieldsn[] = "Name";
shaper_do_input_validation($data, $reqdfields, $reqdfieldsn, $input_errors);
+ if ($data['bandwidth'] && (!is_numeric($data['bandwidth'])))
+ $input_errors[] = "Bandwidth must be an integer.";
+ if ($data['bandwidth'] < 0)
+ $input_errors[] = "Bandwidth cannot be negative.";
+ if ($data['qlimit'] && (!is_numeric($data['qlimit'])))
+ $input_errors[] = "Qlimit must be an integer.";
+ if ($data['qlimit'] < 0)
+ $input_errors[] = "Qlimit must be an positive.";
if ($data['priority'] && (!is_numeric($data['priority'])
- || ($data['priority'] < 1) || ($data['priority'] > 15))) {
- $input_errors[] = "The priority must be an integer between 1 and 15.";
+ || ($data['priority'] < 1) || ($data['priority'] > 15))) {
+ $input_errors[] = "The priority must be an integer between 1 and 15.";
}
if ($data['qlimit'] && (!is_numeric($data['qlimit'])))
$input_errors[] = "Queue limit must be an integer";
OpenPOWER on IntegriCloud