Skip to:
Content

bbPress.org

Ticket #3418: 3418.02.patch

File 3418.02.patch, 2.5 KB (added by johnjamesjacoby, 4 years ago)
  • src/includes/forums/functions.php

     
    230230
    231231        /** Forum Duplicate *******************************************************/
    232232
    233         if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_forum_post_type(), 'post_author' => $forum_author, 'post_content' => $forum_content, 'anonymous_data' => $anonymous_data ) ) ) {
     233        $dupe_args = array(
     234                'post_type'      => bbp_get_forum_post_type(),
     235                'post_author'    => $forum_author,
     236                'post_content'   => $forum_content,
     237                'post_parent'    => $forum_parent_id,
     238                'anonymous_data' => $anonymous_data
     239        );
     240
     241        if ( ! bbp_check_for_duplicate( $dupe_args ) ) {
    234242                bbp_add_error( 'bbp_forum_duplicate', __( '<strong>Error</strong>: This forum already exists.', 'bbpress' ) );
    235243        }
    236244
  • src/includes/replies/functions.php

     
    306306
    307307        /** Reply Duplicate *******************************************************/
    308308
    309         if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_reply_post_type(), 'post_author' => $reply_author, 'post_content' => $reply_content, 'post_parent' => $topic_id, 'anonymous_data' => $anonymous_data ) ) ) {
     309        $dupe_args = array(
     310                'post_type'      => bbp_get_reply_post_type(),
     311                'post_author'    => $reply_author,
     312                'post_content'   => $reply_content,
     313                'post_parent'    => $topic_id,
     314                'anonymous_data' => $anonymous_data
     315        );
     316
     317        if ( ! bbp_check_for_duplicate( $dupe_args ) ) {
    310318                bbp_add_error( 'bbp_reply_duplicate', __( '<strong>Error</strong>: Duplicate reply detected; it looks as though you&#8217;ve already said that.', 'bbpress' ) );
    311319        }
    312320
  • src/includes/topics/functions.php

     
    249249
    250250        /** Topic Duplicate *******************************************************/
    251251
    252         if ( ! bbp_check_for_duplicate( array( 'post_type' => bbp_get_topic_post_type(), 'post_author' => $topic_author, 'post_content' => $topic_content, 'anonymous_data' => $anonymous_data ) ) ) {
     252        $dupe_args = array(
     253                'post_type'      => bbp_get_topic_post_type(),
     254                'post_author'    => $topic_author,
     255                'post_content'   => $topic_content,
     256                'post_parent'    => $forum_id,
     257                'anonymous_data' => $anonymous_data
     258        );
     259
     260        if ( ! bbp_check_for_duplicate( $dupe_args ) ) {
    253261                bbp_add_error( 'bbp_topic_duplicate', __( '<strong>Error</strong>: Duplicate topic detected; it looks as though you&#8217;ve already said that.', 'bbpress' ) );
    254262        }
    255263