Skip to content

Commit

Permalink
improve code
Browse files Browse the repository at this point in the history
  • Loading branch information
zoic21 committed Sep 23, 2024
1 parent bf66199 commit 9f22c3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/class/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public static function isBan(): bool {
}
if (count($ban_ips) > 0 && is_int(intval(config::byKey('security::bantime')))) {
foreach ($ban_ips as $ip => $datetime) {
if (config::byKey('security::bantime') == -1 || $datetime + intval(config::byKey('security::bantime')) > strtotime('now')) {
if (intval(config::byKey('security::bantime')) == -1 || $datetime + intval(config::byKey('security::bantime')) > strtotime('now')) {
if ($ip == $current_ip) {
jeedom::event('ip_ban', false, ['ip' => $ip, 'datetime' => $datetime]);
return true;
Expand Down

0 comments on commit 9f22c3e

Please sign in to comment.