Răsfoiți Sursa

[Web] Fix global maps

andryyy 5 ani în urmă
părinte
comite
a89df381f8
3 a modificat fișierele cu 11 adăugiri și 8 ștergeri
  1. 1 1
      data/web/admin.php
  2. 9 7
      data/web/inc/functions.rspamd.inc.php
  3. 1 0
      data/web/inc/vars.inc.php

+ 1 - 1
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">

+ 9 - 7
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)) {

+ 1 - 0
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',
   )
 );