Skip to content

Commit

Permalink
fix(comments): search rubbish comment from all fields
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Aug 15, 2022
1 parent 2622d66 commit e139e78
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/modules/comments/comments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export class CommentService {
}
const isBlock = [...BlockedKeywords].some((keyword) => {
new RegExp(keyword, "i").test(comment.text);
new RegExp(keyword, "i").test(comment.author);
new RegExp(keyword, "i").test(comment.mail);
comment.url && new RegExp(keyword, "i").test(comment.url);
});
if (isBlock) {
return true;
Expand Down

0 comments on commit e139e78

Please sign in to comment.