[Web] Fail2ban: Only write regex filters if not empty

master
andryyy 2020-08-27 21:13:20 +02:00
parent d4dd1024c9
commit bf62f31b9e
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF
1 changed files with 3 additions and 1 deletions

View File

@ -129,7 +129,9 @@ function fail2ban($_action, $_data = null) {
$regex_array[$rule_id] = $regex; $regex_array[$rule_id] = $regex;
$rule_id++; $rule_id++;
} }
$redis->Set('F2B_REGEX', json_encode($regex_array, JSON_UNESCAPED_SLASHES)); if (!empty($regex_array)) {
$redis->Set('F2B_REGEX', json_encode($regex_array, JSON_UNESCAPED_SLASHES));
}
} }
else { else {
$_SESSION['return'][] = array( $_SESSION['return'][] = array(