Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/22/2018 03:11:02 PM (8 years ago)
Author:
johnjamesjacoby
Message:

Moderation: remove references to blacklist/whitelist verbiage.

This change combines 2 functions into 1, merging _blacklist() checks into _moderation() checks. A new $strict parameter is added, when set to true will continue to check against the WordPress blacklist_keys option name.

  • Tests updated
  • bbp_check_for_blacklist() deprecated
  • Error response keys renamed (non breaking - nothing relies on them)
  • Some docs updates

Fixes #3215. For 2.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/functions.php

    r6850 r6855  
    254254    }
    255255
    256     /** Topic Blacklist *******************************************************/
    257 
    258     if ( ! bbp_check_for_blacklist( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) {
    259         bbp_add_error( 'bbp_topic_blacklist', __( '<strong>ERROR</strong>: Your topic cannot be created at this time.', 'bbpress' ) );
     256    /** Topic Bad Words *******************************************************/
     257
     258    if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content, true ) ) {
     259        bbp_add_error( 'bbp_topic_moderation', __( '<strong>ERROR</strong>: Your topic cannot be created at this time.', 'bbpress' ) );
    260260    }
    261261
     
    269269        $topic_status = bbp_get_pending_status_id();
    270270
    271     // Check a whitelist of possible topic status ID's
     271    // Check possible topic status ID's
    272272    } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( $topic_statuses ), true ) ) {
    273273        $topic_status = sanitize_key( $_POST['bbp_topic_status'] );
     
    550550    }
    551551
    552     /** Topic Blacklist *******************************************************/
    553 
    554     if ( ! bbp_check_for_blacklist( $anonymous_data, $topic_author, $topic_title, $topic_content ) ) {
    555         bbp_add_error( 'bbp_topic_blacklist', __( '<strong>ERROR</strong>: Your topic cannot be edited at this time.', 'bbpress' ) );
     552    /** Topic Bad Words *******************************************************/
     553
     554    if ( ! bbp_check_for_moderation( $anonymous_data, $topic_author, $topic_title, $topic_content, true ) ) {
     555        bbp_add_error( 'bbp_topic_moderation', __( '<strong>ERROR</strong>: Your topic cannot be edited at this time.', 'bbpress' ) );
    556556    }
    557557
     
    569569        }
    570570
    571     // Check a whitelist of possible topic status ID's
     571    // Check possible topic status ID's
    572572    } elseif ( ! empty( $_POST['bbp_topic_status'] ) && in_array( $_POST['bbp_topic_status'], array_keys( $topic_statuses ), true ) ) {
    573573        $topic_status = sanitize_key( $_POST['bbp_topic_status'] );
Note: See TracChangeset for help on using the changeset viewer.