MyBB Community Forums

Full Version: Quote filtered bad word instead of original?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey.

I know when you quote a post with a bad word in it, in the quote is the original word. Is there any way to make it quote the FILTERED word instead of the original when quoting a post?

Thanks!
FW
Huh? You mean whenever a user quote a post they won't see the bad word? I believe the bad words a filtered in quotes as well in the posts.
Uh uh.

On my test board, I make "test" filter to "****". Then I posted a thread with test in it. Ok, the thread posted and test was changed to ****.
But when I quoted the post (in the new reply page or quick reply), instead of showing **** it said test. but it changed to **** as soon as I posted the quote, so it still filtered it, but only after I posted it.

Would there be a way to make it show the filtered word instead of the original on a new reply/thread or quick reply?? If not, just say! Wink
The thing about the bad word filter is it doesn't change any of the actual text in the database. Instead it simply displays the filtered word *instead* of the bad word when the post is displayed.

This is for security reasons mainly, seeing as if the bad word filter altered the post in the database, a hacker could convert all words like "a", "the", "it" etc into anything, and you wouldn't be able to change them back.

It should be possible to apply the filters to the new reply and quick reply boxes, but if you decide that word shouldn't be filtered anymore, there is no way of reverting the post to the original without doing it manually.
Ah. I see.

Well, anyway, thanks for the help guys. Smile
If you really do want to do that, open newreply.php and add:
$quoted_post['message'] = $parser->parse_badwords($quoted_post['message']);
before (around line 502)
$quoted_post['message'] = preg_replace('#(^|\r|\n)/me ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} \\2", $quoted_post['message']);

And in xmlhttp.php, add:
require_once MYBB_ROOT."inc/class_parser.php";
		$parser = new postParser;
		$quoted_post['message'] = $parser->parse_badwords($quoted_post['message']);
Before: (around line 484)
$quoted_post['message'] = preg_replace('#(^|\r|\n)/me ([^\r\n<]*)#i', "\\1* {$quoted_post['username']} \\2", $quoted_post['message']);