MyBB Community Forums

Full Version: Badword filter issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello

I am using badword filter for a different purpose than badwords. In am linking abbreviations and technical words to an external Wiki. However, with the latest upgrade (1.6.1) this functionality appears to be broken. Following link should explain the issue better:

Redundant replacement

The value is CC to be replaced with CC

Another question - how could I exclude URLs and titles from the parser?

Thanks for the good work.

Lily
(2011-02-05, 05:42 PM)Lily Wrote: [ -> ]Another question - how could I exclude URLs and titles from the parser?

It's complex, but may possible to do.
You have to remove or commenting the PHP code inside, showthread.php like title, post, and many more..

see and find this code
$parser->parse_badwords
I have done some further testing on the problem and found the issue to be cause by the following line of code in the class_parser.php:

Ensure we run the replacement enough times but not recursively (i.e. not while(preg_match..))
.....

for($i=1; $i < $count; ++$i)

When I remove this line of code the links display correctly.

It would be great to get a solution to this that is standard in the product.

Please let me know if you want to undo the fix for you to do further testing. My users are pretty patient Big Grin
(2011-02-06, 06:39 AM)FBI Wrote: [ -> ]
(2011-02-05, 05:42 PM)Lily Wrote: [ -> ]Another question - how could I exclude URLs and titles from the parser?

It's complex, but may possible to do.
You have to remove or commenting the PHP code inside, showthread.php like title, post, and many more..

see and find this code
$parser->parse_badwords

Thanks for the response. Yes, I have to make changes to 2 files:

showthread.php, forumdisplay.php and functions_post.php

Still need to figure out how to ignore the URL in the post.