mirror of
https://github.com/luxfi/pics.git
synced 2026-07-26 21:08:58 +00:00
Bugfix replace text filters not replacing all occurences of text in certain circumstances
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user