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

This commit is contained in:
Thomas Lynch
2024-07-16 20:19:33 +10:00
parent 971ca9d8a8
commit 4f9c4a4742
+3 -1
View File
@@ -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;