Bugfix replace text filters not replacing all occurences of text in certain circumstances

master
Thomas Lynch 2 months ago
parent 971ca9d8a8
commit 4f9c4a4742
  1. 4
      lib/post/filteractions.js

@ -51,7 +51,9 @@ module.exports = async (req, res, globalFilter, hit, filter, redirect) => {
//the filter could have hit any part of the combinedstring
for (const field of FIELDS_TO_REPLACE) {
if (req.body[field]) {
req.body[field] = req.body[field].replaceAll(hit, filter.replaceText);
for (const filterInput of filter.filters) {
req.body[field] = req.body[field].replaceAll(filterInput, filter.replaceText);
}
}
}
return;

Loading…
Cancel
Save