Skip to content

Commit

Permalink
minor efficiency fix
Browse files Browse the repository at this point in the history
  • Loading branch information
turnermm committed Jul 4, 2020
1 parent dc3d3b9 commit 58a9d56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion action.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ function is_allowed($allowed, $ip) {
$cache = $allowed;
}

if(!$allowed || preg_match("/" . $allowed . "/", $ip) ) { // if allowed string is empty then all ips are allowed
if(!$allowed ) return false; // if allowed string is empty then all ips are allowed
if( preg_match("/" . $allowed . "/", $ip) ) {
return true;
}
return false;
Expand Down

0 comments on commit 58a9d56

Please sign in to comment.