Skip to:
Content

BuddyPress.org

Changeset 6127


Ignore:
Timestamp:
06/21/2012 06:46:36 PM (12 years ago)
Author:
djpaul
Message:

When a part of an activity item matches WordPress' word blacklist, allow the activity
to be recorded to the database, but mark it as spam. Fixes #4284.

Location:
trunk/bp-activity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-admin.php

    r6123 r6127  
    306306
    307307                case 'ham' :
     308                    /**
     309                     * Remove moderation and blacklist checks in case we want to ham an activity
     310                     * which contains one of these listed keys.
     311                     */
     312                    remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
     313                    remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2, 1 );
     314
    308315                    bp_activity_mark_as_ham( $activity );
    309316                    $result = $activity->save();
  • trunk/bp-activity/bp-activity-filters.php

    r6095 r6127  
    150150
    151151    // Only check specific types of activity updates
    152     if ( !in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
     152    if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )
    153153        return;
    154154
    155     // Unset the activity component so activity stream update fails
    156     if ( !bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) )
    157         $activity->component = false;
     155    // Mark as spam
     156    if ( ! bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) )
     157        bp_activity_mark_as_spam( $activity, 'by_blacklist' );
    158158}
    159159
Note: See TracChangeset for help on using the changeset viewer.