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
This commit is contained in:
stilez 2016-09-10 07:53:52 +01:00 committed by GitHub
parent d2013d1257
commit 667fd2b7e2

View File

@ -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) {