Skip to content

Commit

Permalink
[Web] fix invalid rspamd map check
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddleSpl0it committed Apr 4, 2024
1 parent 0807c12 commit c68a436
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion data/web/inc/functions.rspamd.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function rspamd_maps($_action, $_data = null) {
return false;
}
$maps = (array)$_data['map'];
$valid_maps = array();
foreach ($maps as $map) {
foreach ($RSPAMD_MAPS as $rspamd_map_type) {
if (!in_array($map, $rspamd_map_type)) {
Expand All @@ -151,9 +152,12 @@ function rspamd_maps($_action, $_data = null) {
'log' => array(__FUNCTION__, $_action, '-'),
'msg' => array('global_map_invalid', $map)
);
continue;
} else {
array_push($valid_maps, $map);
}
}
}
foreach ($valid_maps as $map) {
try {
if (file_exists('/rspamd_custom_maps/' . $map)) {
$map_content = trim($_data['rspamd_map_data']);
Expand Down

0 comments on commit c68a436

Please sign in to comment.