diff --git a/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php b/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php index c012424..79f1334 100644 --- a/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php +++ b/app/Livewire/Ui/Security/Modal/Fail2BanJailModal.php @@ -248,23 +248,16 @@ class Fail2BanJailModal extends ModalComponent private function isStillBanned(string $jail, string $ip): bool { - // 1) Direkt: banip + // 1) Direktcheck: liefert 1/0 je nach Version, ist harmlos wenn 0 [, $out1] = $this->f2b('get '.escapeshellarg($jail).' banip '.escapeshellarg($ip)); if (preg_match('/\b1\b/', $out1)) return true; - // 2) Liste: banlist (Rohliste, whitespace-separiert) - [, $out2] = $this->f2b('get '.escapeshellarg($jail).' banlist'); - if ($out2 !== '') { - $list = array_filter(array_map('trim', preg_split('/\s+/', trim($out2)))); - if (in_array($ip, $list, true)) return true; - } - - // 3) Notfall: status-Parsing + // 2) Fallback: aus `status ` die Liste parsen (das hast du ohnehin) [, $out3] = $this->f2b('status '.escapeshellarg($jail)); $ipList = $this->firstMatch('/Banned IP list:\s*(.+)$/mi', $out3) ?: ''; return $ipList !== '' && preg_match('/(^|\s)'.preg_quote($ip,'/').'(\s|$)/', $ipList) === 1; } - + private function getBantime(string $jail): int { [, $out] = $this->f2b('get '.escapeshellarg($jail).' bantime');