Skip to:
Content

bbPress.org

Ticket #1477: spam-posts-are-not-latest.patch

File spam-posts-are-not-latest.patch, 1.4 KB (added by Nightgunner5, 15 years ago)
  • bbp-includes/bbp-reply-functions.php

     
    428428        // Verifiy the reply ID
    429429        if ( $reply_id = bbp_get_reply_id ( $reply_id ) ) {
    430430
     431                // Make sure the reply isn't marked as spam or deleted by a plugin.
     432                if ( get_post_field( 'post_status', $topic_id ) != 'publish' )
     433                        return;
     434
    431435                // Get the topic ID if none was passed
    432436                if ( empty( $topic_id ) )
    433437                        $topic_id = bbp_get_reply_topic_id ( $reply_id );
  • bbp-includes/bbp-topic-functions.php

     
    447447 * @param int $topic_id
    448448 *
    449449 * @uses bbp_get_topic_id()
     450 * @uses get_post_field()
    450451 * @uses bbp_get_topic_forum_id()
    451452 * @uses get_post_ancestors()
    452453 * @uses bbp_is_forum()
     
    457458        // Validate topic_id
    458459        if ( $topic_id = bbp_get_topic_id( $topic_id ) ) {
    459460
     461                // Make sure the topic isn't marked as spam or deleted by a plugin.
     462                if ( get_post_field( 'post_status', $topic_id ) != 'publish' )
     463                        return;
     464
    460465                // Get the forum ID if none was passed
    461466                if ( empty( $forum_id )  )
    462467                        $forum_id = bbp_get_topic_forum_id( $topic_id );