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] Fix global maps

a89df381
andryyy <[email protected]> 7 years ago
data/web/admin.php                    |  2 +-
 data/web/inc/functions.rspamd.inc.php | 16 +++++++++-------
 data/web/inc/vars.inc.php             |  1 +
 3 files changed, 11 insertions(+), 8 deletions(-)

Diff

diff --git a/data/web/admin.php b/data/web/admin.php
index c15058a8..ae22436a 100644
--- a/data/web/admin.php
+++ b/data/web/admin.php
@@ -1186,7 +1186,7 @@ if (!isset($_SESSION['gal']) && $license_cache = $redis->Get('LICENSE_STATUS_CAC
             <div class="form-group">
               <label class="control-label col-sm-3" for="<?=$rspamd_regex_map;?>"><?=$rspamd_regex_desc;?><br><small><?=$rspamd_regex_map;?></small></label>
               <div class="col-sm-9">
-                <textarea id="<?=$rspamd_regex_map;?>" spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control textarea-code" rows="10" name="rspamd_regex_map_data" required><?=file_get_contents('/rspamd_custom_maps/' . $rspamd_regex_map);?></textarea>
+                <textarea id="<?=$rspamd_regex_map;?>" spellcheck="false" autocorrect="off" autocapitalize="none" class="form-control textarea-code" rows="10" name="rspamd_map_data" required><?=file_get_contents('/rspamd_custom_maps/' . $rspamd_regex_map);?></textarea>
               </div>
             </div>
             <div class="form-group">
diff --git a/data/web/inc/functions.rspamd.inc.php b/data/web/inc/functions.rspamd.inc.php
index a0312f49..0753a009 100644
--- a/data/web/inc/functions.rspamd.inc.php
+++ b/data/web/inc/functions.rspamd.inc.php
@@ -218,13 +218,15 @@ function rspamd($_action, $_data = null) {
       }
       $maps = (array)$_data['map'];
       foreach ($maps as $map) {
-        if (!in_array($map, $RSPAMD_MAPS)) {
-          $_SESSION['return'][] = array(
-            'type' => 'danger',
-            'log' => array(__FUNCTION__, $_action, $_data_log),
-            'msg' => array('global_map_invalid', $map)
-          );
-          continue;
+        foreach ($RSPAMD_MAPS as $rspamd_map_type) {
+          if (!in_array($map, $rspamd_map_type)) {
+            $_SESSION['return'][] = array(
+              'type' => 'danger',
+              'log' => array(__FUNCTION__, $_action, $_data_log),
+              'msg' => array('global_map_invalid', $map)
+            );
+            continue;
+          }
         }
         try {
           if (file_exists('/rspamd_custom_maps/' . $map)) {
diff --git a/data/web/inc/vars.inc.php b/data/web/inc/vars.inc.php
index 167f3c9a..9b9705fd 100644
--- a/data/web/inc/vars.inc.php
+++ b/data/web/inc/vars.inc.php
@@ -166,6 +166,7 @@ $RSPAMD_MAPS = array(
     'Recipient Whitelist' => 'global_rcpt_whitelist.map',
     'Fishy TLDS (only fired in combination with bad words)' => 'fishy_tlds.map',
     'Bad Words (only fired in combination with fishy TLDs)' => 'bad_words.map',
+    'Bad Words DE (only fired in combination with fishy TLDs)' => 'bad_words_de.map',
     'Bad Languages' => 'bad_languages.map',
   )
 );