laravel-firewall
laravel-firewall copied to clipboard
Update BlockIp.php
The check has to be "less than" comparison instead of "not equals".
I was testing the firewall to see if it blocks:
- first the
attempts
was10
- then I reloaded the page with a "blockable" content 6 times
- then I reduced the
attempts
to5
This caused the firewall to NOT block the IP.
Here is a before after comparison for the example above:
// before
if ($count != config('firewall.middleware.' . $event->log->middleware . '.auto_block.attempts')) {
return;
}
// values
if (6 != 5) {
return; // doesn't block the IP
}
// after
if ($count < config('firewall.middleware.' . $event->log->middleware . '.auto_block.attempts')) {
return;
}
// values
if (6 < 5) {
return; // blocks the IP
}
Good idea 👍
yeah, I mentioned that issue in #66, they made me remove it from the pr.