aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-05-06 14:06:00 -0300
committerRenato Botelho <garga@FreeBSD.org>2015-05-06 14:06:00 -0300
commit181d2df4d0345dea266880c63045fc24b27fd49c (patch)
treeed1806f53dc14f33a226b30b38fcc6313d2d957d
parentb128b22a7fb0fb855e362ef3705e4d3a703abe1e (diff)
downloadpfsense-packages-181d2df4d0345dea266880c63045fc24b27fd49c.tar.gz
pfsense-packages-181d2df4d0345dea266880c63045fc24b27fd49c.tar.bz2
pfsense-packages-181d2df4d0345dea266880c63045fc24b27fd49c.zip
Use is_numericint() in places we need a positive number
-rwxr-xr-xconfig/squid3/34/squid.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/config/squid3/34/squid.inc b/config/squid3/34/squid.inc
index b53ec37a..0d22264c 100755
--- a/config/squid3/34/squid.inc
+++ b/config/squid3/34/squid.inc
@@ -469,7 +469,7 @@ function squid_validate_general($post, &$input_errors) {
$log_rotate = trim($post['log_rotate']);
- if (!empty($log_rotate) && (!is_numeric($log_rotate) or ($log_rotate < 1)))
+ if (!empty($log_rotate) && (!is_numericint($log_rotate) or ($log_rotate < 1)))
$input_errors[] = 'You must enter a valid number of days in the \'Log rotate\' field';
$webgui_port = $config['system']['webgui']['port'];
@@ -547,23 +547,23 @@ function squid_validate_cache($post, &$input_errors) {
foreach ($num_fields as $field => $name) {
$value = trim($post[$field]);
- if (!is_numeric($value) || ($value < 0))
+ if (!is_numericint($value))
$input_errors[] = "You must enter a valid value for '$field'";
}
$value = trim($post['minimum_object_size']);
- if (!is_numeric($value) || ($value < 0))
+ if (!is_numericint($value))
$input_errors[] = 'You must enter a valid value for \'Minimum object size\'';
if (!empty($post['cache_swap_low'])) {
$value = trim($post['cache_swap_low']);
- if (!is_numeric($value) || ($value > 100))
+ if (!is_numericint($value) || ($value > 100))
$input_errors[] = 'You must enter a valid value for \'Low-water-mark\'';
}
if (!empty($post['cache_swap_high'])) {
$value = trim($post['cache_swap_high']);
- if (!is_numeric($value) || ($value > 100))
+ if (!is_numericint($value) || ($value > 100))
$input_errors[] = 'You must enter a valid value for \'High-water-mark\'';
}
@@ -633,25 +633,25 @@ function squid_validate_traffic($post, &$input_errors) {
foreach ($num_fields as $field => $name) {
$value = trim($post[$field]);
- if (!is_numeric($value) || ($value < 0))
+ if (!is_numericint($value))
$input_errors[] = "The field '$name' must contain a positive number";
}
if (!empty($post['quick_abort_min'])) {
$value = trim($post['quick_abort_min']);
- if (!is_numeric($value))
+ if (!is_numericint($value))
$input_errors[] = "The field 'Finish when remaining KB' must contain a positive number";
}
if (!empty($post['quick_abort_max'])) {
$value = trim($post['quick_abort_max']);
- if (!is_numeric($value))
+ if (!is_numericint($value))
$input_errors[] = "The field 'Abort when remaining KB' must contain a positive number";
}
if (!empty($post['quick_abort_pct'])) {
$value = trim($post['quick_abort_pct']);
- if (!is_numeric($value) || ($value > 100))
+ if (!is_numericint($value) || ($value > 100))
$input_errors[] = "The field 'Finish when remaining %' must contain a percentage";
}
}