Jump to content

Profanity filters


Go to solution Solved by Matt,

Recommended Posts

When using loose profanity filter with "Block submission" action it works not as expected because of js regexp.
 

reggie = new RegExp("(?:\\b|\\s|^)(" + looseWords.join('|') + "\\w*)(?:\\b|\\s|$)","ig");

At first it only find words starting with filter. If i try to filter "word" it match "wordpress" but not "sword". 
Secondly "\w" does not match non-latin word characters but "\b" includes non-latin letters in opposite. 
In last js filters content on browser side only and there is no content validation in php backend when using "Block submission" option. So it's easy to prevent filtering by devtools in browser and post bad words out of control.
 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...