Skip to:
Content
Pages
Categories
Search
Top
Bottom

BUG(?) – allowing title/content with disallowed words

  • @scmsteve

    Participant

    We had a rash of spam coming into our form today and we were confused because even after adding keywords in to the “Disallowed Comment Keys” in WordPress we were still seeing posts making it through to the forums that contained words we put into that list.

    I think I found a bug in bbPress, and man, it must be rather longstanding… I found a post in the forum from about two years ago that talked about the reworking of the blacklist to using the disallow list [or that the name of the list had changed], and maybe this crept in at that time.

    Here is the code:

    bbpress/includes/common/functions.php:
    866 // Strict mode uses WordPress “blacklist” settings
    867 if ( true === $strict ) {
    868 $hook_name = ‘blacklist’;
    869 $option_name = ‘disallow_keys’;

    In actuality, the key name in the options table is ‘disallowed_keys’.

    I changed the code on our site and it seems to have stopped the flood. Would you take a look and see if I am correct about this? If not, please let me know and I will revert our copy and apologize for the false alarm. 🙂

    Thanks!
    Steve

Viewing 4 replies - 1 through 4 (of 4 total)
  • @robin-w

    Moderator

    thanks for your post, I will take a look at this later today

    @robin-w

    Moderator

    you are correct, and yes I had raised a ticket to fix that option when it was called blacklist_keys, but the wrong change was made

    I have raised a new ticket to add it to the list, but bbpress releases new version at quite long intervals. (I am not a bbpress author)

    In the meantime you can either leave your change in and make a note to refresh on new bbpress versions, or there are some hooks to skip moderation and maybe add a new version of the code – I’ll take a look at that soon

    @robin-w

    Moderator

    Until bbpress fixes this, the following code will correct

    add_filter ('bbp_blacklist_keys' , 'rew_disallowed_keys') ;
    
    function rew_disallowed_keys () {
    	$moderation = trim( get_option( 'disallowed_keys' ) );
    return $moderation ;
    }

    If you are using

    bbp style pack

    a new version incorporating this fix will be released shortly and the fix will automatically be applied – with an option in bbPress bug fixes tab to turn that off if you don’t want it, or are using you own code

    @scmsteve

    Participant

    Thanks @robin-w, that is perhaps more stable than modifying the plugin code directly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar