diff options
author | stilez <stilez@users.noreply.github.com> | 2016-09-10 07:53:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-10 07:53:52 +0100 |
commit | 667fd2b7e2012ea1632fe302de20458f1bbc77d4 (patch) | |
tree | 96905cace047289bf354661faeb0c438b425e59f | |
parent | d2013d12579b151307c8f41c1e29a13c56522198 (diff) | |
download | pfsense-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.php | 4 |
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) { |