summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstilez <stilez@users.noreply.github.com>2016-09-10 07:53:52 +0100
committerGitHub <noreply@github.com>2016-09-10 07:53:52 +0100
commit667fd2b7e2012ea1632fe302de20458f1bbc77d4 (patch)
tree96905cace047289bf354661faeb0c438b425e59f
parentd2013d12579b151307c8f41c1e29a13c56522198 (diff)
downloadpfsense-667fd2b7e2012ea1632fe302de20458f1bbc77d4.zip
pfsense-667fd2b7e2012ea1632fe302de20458f1bbc77d4.tar.gz
Redundant comparison
if it's a numeric integer (hence non-empty [0-9]+ ) and the first char isn't "0" then the value will always be >0, so test is redundant
-rw-r--r--src/usr/local/www/firewall_rules_edit.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php
index 9bb95e7..fa5d549 100644
--- a/src/usr/local/www/firewall_rules_edit.php
+++ b/src/usr/local/www/firewall_rules_edit.php
@@ -42,8 +42,8 @@ if (isset($_POST['referer'])) {
}
function is_posnumericint($arg) {
- // Note that to be safe we do not allow any leading zero - "01", "007"
- return (is_numericint($arg) && $arg[0] != '0' && $arg > 0);
+ // Integer > 0? (Note that to be safe we do not allow any leading zero - "01", "007")
+ return (is_numericint($arg) && $arg[0] != '0');
}
function is_aoadv_used($rule_config) {
OpenPOWER on IntegriCloud