From 667fd2b7e2012ea1632fe302de20458f1bbc77d4 Mon Sep 17 00:00:00 2001 From: stilez Date: Sat, 10 Sep 2016 07:53:52 +0100 Subject: [PATCH] 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 --- src/usr/local/www/firewall_rules_edit.php | 4 ++-- 1 file 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 9bb95e7028..fa5d549b4f 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) {