NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Commit

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

bf62f31b
andryyy <[email protected]> 6 years ago
data/web/inc/functions.fail2ban.inc.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Diff

diff --git a/data/web/inc/functions.fail2ban.inc.php b/data/web/inc/functions.fail2ban.inc.php
index 72d60062..b7918180 100644
--- a/data/web/inc/functions.fail2ban.inc.php
+++ b/data/web/inc/functions.fail2ban.inc.php
@@ -129,7 +129,9 @@ function fail2ban($_action, $_data = null) {
               $regex_array[$rule_id] = $regex;
               $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 {
             $_SESSION['return'][] = array(