We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Minor but annoying little bug/issue - Badwords | Forum

Michael
Michael Aug 1 '13
First off this is a great plugin, if you have a social network aimed at users 13 upwards then you will need this to keep the public/main newsfeed clean for minors.

The only issue I have is its quite embarrassing when part of a users name gets censored. I would personally drop the badwords checker from checking names and leave the rest how it is. I have attached a screenshot to help explain myself better


Attachments:
  examplename.png (82.28Kb)
Michael
Michael Aug 1 '13
Here's a much better example as it picks up the profile questions as well, which I didnt spot when writing the above post
Attachments:
  betterexample.png (136.32Kb)
Kairat Bakitow
Kairat Bakitow Aug 1 '13
If you want to replace a whole words, then open file "ow_plugins/badwords/bol/service.php" and replace code (line 21-22):


    CONST PHP_PATTERN = '/(?:{$words})(?:(?![^<]*?>))/i';    

    CONST JS_PATTERN  = '/(?:{$words})(?:(?![^<]*?>))/ig';


by this code:


    CONST PHP_PATTERN = '/(?:\b{$words})\b(?:(?![^<]*?>))/i';    

    CONST JS_PATTERN  = '/(?:\b{$words})\b(?:(?![^<]*?>))/ig';

The Forum post is edited by Kairat Bakitow Aug 1 '13
Michael
Michael Aug 2 '13
Will this resolve what I mentioned in the two previous posts?
Kairat Bakitow
Kairat Bakitow Aug 2 '13

The result in this case will be next (word "demo" is bad word in this example):


#censored# - (under censored word "demo" ).


demonstration - (Without replacement. Because it is a whole word)

Sean
Sean Nov 7 '13
I have used your new code to replace only whole words but it is still replacing sections of words only.



You do not have permission to reply this topic