Closed (outdated)
Project:
Wordfilter
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Dec 2010 at 19:11 UTC
Updated:
28 Nov 2016 at 10:45 UTC
Jump to comment: Most recent
Comments
Comment #1
white_pawn commentedWell, I guess one easy way to do it would be to change line 355:
$pattern = '/'. preg_quote($word->words, '/') .'/i';to
$pattern = '/'. $word->words.'/i';Which would work great in my case. However, this means messing with the core, which is not very nice for many reasons, as we all know. It could be a basis for a future addon, though, if anyone's interested.
Comment #2
dunx commentedThe project would be so much more powerful if it just allowed the entry of regular expressions without the need for the PCRE_UTF8 stuff (although I don't fully understand why that's required anyway).
Would resolve the issues raised against D7:
http://drupal.org/node/1176872
http://drupal.org/node/883940
You could also do away with the standalone feature entirely, tweak the code as noted above (not that I've tested that) and provide a few handy hints on the configuration page for users new to regex patterns. Would also suggest that the UI would need to change as the | would get confusing (see stringoverrides module for an example).
Upgrade would be easy as you can just add the necessary regex to the values stored as standalone (and fix those two issues above raised on D7, but also affecting D6).
My usage case is simply for a rude word filter in a forum and I'm coming from a phpbb background. I would want to replace the "FFFF" word and "FFFFer", "FFFFwit", etc. with something less prone to be noticed by work place filters! So "/[^ ]FFFF(.*)[ $]/i" to "feck\\1".
Also, don't sort alphabetically, but use weighting so we can better handle special cases like "Arsenal" and "Scunthorpe"!
+lots :) or is this a brand new module we're talking about?
Comment #3
mxh commentedDrupal 6 support ended on February 24th 2016. https://www.drupal.org/drupal-6-eol