Changeset 10860
- Timestamp:
- 06/01/2016 09:23:09 PM (8 years ago)
- Location:
- trunk/src/bp-activity
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-filters.php
r10852 r10860 156 156 157 157 // Only check specific types of activity updates. 158 if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) )158 if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) { 159 159 return; 160 161 // Unset the activity component so activity stream update fails 160 } 161 162 // Send back the error so activity update fails. 162 163 // @todo This is temporary until some kind of moderation is built. 163 if ( !bp_core_check_for_moderation( $activity->user_id, '', $activity->content ) ) 164 $moderate = bp_core_check_for_moderation( $activity->user_id, '', $activity->content, 'wp_error' ); 165 if ( is_wp_error( $moderate ) ) { 166 $activity->errors = $moderate; 167 168 // Backpat. 164 169 $activity->component = false; 170 } 165 171 } 166 172 … … 175 181 176 182 // Only check specific types of activity updates. 177 if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) 183 if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) { 178 184 return; 179 180 // Mark as spam. 181 if ( ! bp_core_check_for_blacklist( $activity->user_id, '', $activity->content ) ) 182 bp_activity_mark_as_spam( $activity, 'by_blacklist' ); 185 } 186 187 // Send back the error so activity update fails. 188 // @todo This is temporary until some kind of trash status is built. 189 $blacklist = bp_core_check_for_blacklist( $activity->user_id, '', $activity->content, 'wp_error' ); 190 if ( is_wp_error( $blacklist ) ) { 191 $activity->errors = $blacklist; 192 193 // Backpat. 194 $activity->component = false; 195 } 183 196 } 184 197 -
trunk/src/bp-activity/bp-activity-functions.php
r10858 r10860 3326 3326 * @since 1.6.0 3327 3327 * 3328 * @todo We should probably save $source to activity meta. 3329 * 3328 3330 * @param BP_Activity_Activity $activity The activity item to be spammed. 3329 3331 * @param string $source Optional. Default is "by_a_person" (ie, a person has
Note: See TracChangeset
for help on using the changeset viewer.