banbuilder icon indicating copy to clipboard operation
banbuilder copied to clipboard

Request: return boolean if bad word is found

Open gdnwebmedia opened this issue 9 years ago • 4 comments

I would like to execute further actions if a bad word is found multiple times from the same user. How can I get a 1:0 if a string had a bad word or not?

gdnwebmedia avatar Jan 25 '16 08:01 gdnwebmedia

+1

LukasJK avatar Feb 11 '16 12:02 LukasJK

use Snipe\BanBuilder\CensorWords;
$censor = new CensorWords;
$yourstring = 'Go to hell, you b1tch!';
$result = $censor->censorString($yourstring);
$hasMatch = count($result['matched']) > 0

koesie10 avatar Feb 25 '16 19:02 koesie10

@koesie10 this will work?

KieronWiltshire avatar Jun 01 '18 09:06 KieronWiltshire

@koesie10 this will work?

Yes, this still works.

mauricius avatar Jan 10 '19 09:01 mauricius