Skip to:
Content

BuddyPress.org

Ticket #3667: suzuka-1.patch

File suzuka-1.patch, 1.3 KB (added by DJPaul, 13 years ago)
  • bp-forums/bp-forums-functions.php

     
    160160        $r = wp_parse_args( $args, $defaults );
    161161        extract( $r, EXTR_SKIP );
    162162
     163        // Check if the user is a spammer
     164        if ( bp_core_is_user_spammer( $topic_poster ) || bp_core_is_user_deleted( $topic_poster ) )
     165                return false;
     166
    163167        $topic_title = strip_tags( $topic_title );
    164 
    165168        if ( empty( $topic_title ) || !strlen( trim( $topic_title ) ) )
    166169                return false;
    167170
     
    195198        $r = wp_parse_args( $args, $defaults );
    196199        extract( $r, EXTR_SKIP );
    197200
     201        // Check if the user is a spammer
     202        if ( bp_core_is_user_spammer( $bp->loggedin_user->id ) || bp_core_is_user_deleted( $bp->loggedin_user->id ) )
     203                return false;
     204
    198205        // bb_insert_topic() will append tags, but not remove them. So we remove all existing tags.
    199206        bb_remove_topic_tags( $topic_id );
    200207
     
    486493        $r = wp_parse_args( $args, $defaults );
    487494        extract( $r, EXTR_SKIP );
    488495
     496        // Check if the user is a spammer
     497        if ( bp_core_is_user_spammer( $bp->loggedin_user->id ) || bp_core_is_user_deleted( $bp->loggedin_user->id ) )
     498                return false;
     499
    489500        if ( !$post = bp_forums_get_post( $post_id ) )
    490501                $post_id = false;
    491502