diff --git src/bp-activity/bp-activity-admin.php src/bp-activity/bp-activity-admin.php
index 8c3408f0b..8c765f35e 100644
|
|
|
function bp_activity_admin_load() {
|
| 399 | 399 | * which contains one of these listed keys. |
| 400 | 400 | */ |
| 401 | 401 | remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2 ); |
| 402 | | remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2 ); |
| | 402 | remove_action( 'bp_activity_before_save', 'bp_activity_check_disallowed_keys', 2 ); |
| 403 | 403 | |
| 404 | 404 | bp_activity_mark_as_ham( $activity ); |
| 405 | 405 | $result = $activity->save(); |
diff --git src/bp-activity/bp-activity-filters.php src/bp-activity/bp-activity-filters.php
index ce727db93..1e57372ee 100644
|
|
|
add_action( 'bp_activity_before_save', 'bp_activity_at_name_filter_updates' );
|
| 117 | 117 | |
| 118 | 118 | // Activity stream moderation. |
| 119 | 119 | add_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 ); |
| 120 | | add_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys', 2, 1 ); |
| | 120 | add_action( 'bp_activity_before_save', 'bp_activity_check_disallowed_keys', 2, 1 ); |
| 121 | 121 | |
| 122 | 122 | /** Functions *****************************************************************/ |
| 123 | 123 | |
| … |
… |
function bp_activity_check_moderation_keys( $activity ) {
|
| 172 | 172 | /** |
| 173 | 173 | * Mark the posted activity as spam, if it contains disallowed keywords. |
| 174 | 174 | * |
| 175 | | * @since 1.6.0 |
| | 175 | * @since 7.0.0 |
| 176 | 176 | * |
| 177 | 177 | * @param BP_Activity_Activity $activity The activity object to check. |
| 178 | 178 | */ |
| 179 | | function bp_activity_check_blacklist_keys( $activity ) { |
| | 179 | function bp_activity_check_disallowed_keys( $activity ) { |
| 180 | 180 | |
| 181 | 181 | // Only check specific types of activity updates. |
| 182 | 182 | if ( ! in_array( $activity->type, bp_activity_get_moderated_activity_types() ) ) { |
| … |
… |
function bp_activity_check_blacklist_keys( $activity ) {
|
| 185 | 185 | |
| 186 | 186 | // Send back the error so activity update fails. |
| 187 | 187 | // @todo This is temporary until some kind of trash status is built. |
| 188 | | $blacklist = bp_core_check_for_blacklist( $activity->user_id, '', $activity->content, 'wp_error' ); |
| 189 | | if ( is_wp_error( $blacklist ) ) { |
| 190 | | $activity->errors = $blacklist; |
| | 188 | $disallowed = bp_core_check_for_disallowed_keys( $activity->user_id, '', $activity->content, 'wp_error' ); |
| | 189 | if ( is_wp_error( $disallowed ) ) { |
| | 190 | $activity->errors = $disallowed; |
| 191 | 191 | |
| 192 | 192 | // Backpat. |
| 193 | 193 | $activity->component = false; |
diff --git src/bp-core/bp-core-moderation.php src/bp-core/bp-core-moderation.php
index 409e9082d..16e3a4ebd 100644
|
|
|
function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '',
|
| 187 | 187 | /** |
| 188 | 188 | * Check for blocked keys. |
| 189 | 189 | * |
| 190 | | * @since 1.6.0 |
| 191 | | * @since 2.6.0 Added $error_type parameter. |
| 192 | | * |
| 193 | | * @todo Why don't we use wp_blacklist_check() for this? |
| | 190 | * @since 7.0.0 |
| 194 | 191 | * |
| 195 | 192 | * @param int $user_id User ID. |
| 196 | 193 | * @param string $title The title of the content. |
| … |
… |
function bp_core_check_for_moderation( $user_id = 0, $title = '', $content = '',
|
| 198 | 195 | * @param string $error_type The error type to return. Either 'bool' or 'wp_error'. |
| 199 | 196 | * @return bool|WP_Error True if test is passed, false if fail. |
| 200 | 197 | */ |
| 201 | | function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) { |
| | 198 | function bp_core_check_for_disallowed_keys( $user_id = 0, $title = '', $content = '', $error_type = 'bool' ) { |
| 202 | 199 | |
| 203 | 200 | /** |
| 204 | 201 | * Filters whether or not to bypass checking for blocked keys. |
| 205 | 202 | * |
| 206 | 203 | * @since 2.2.0 |
| | 204 | * @deprecated 7.0.0 Use 'bp_bypass_check_for_disallowed_keys' instead. |
| | 205 | * |
| | 206 | * @param bool $value Whether or not to bypass checking. Default false. |
| | 207 | * @param int $user_id Topic of reply author ID. |
| | 208 | * @param string $title The title of the content. |
| | 209 | * @param string $content $the content being posted. |
| | 210 | */ |
| | 211 | if ( apply_filters_deprecated( 'bp_bypass_check_for_blacklist', array( false, $user_id, $title, $content ), '7.0.0', 'bp_bypass_check_for_disallowed_keys' ) ) { |
| | 212 | return true; |
| | 213 | } |
| | 214 | |
| | 215 | /** |
| | 216 | * Filters whether or not to bypass checking for blocked keys. |
| | 217 | * |
| | 218 | * @since 7.0.0 |
| 207 | 219 | * |
| 208 | 220 | * @param bool $value Whether or not to bypass checking. Default false. |
| 209 | 221 | * @param int $user_id Topic of reply author ID. |
| 210 | 222 | * @param string $title The title of the content. |
| 211 | 223 | * @param string $content $the content being posted. |
| 212 | 224 | */ |
| 213 | | if ( apply_filters( 'bp_bypass_check_for_blacklist', false, $user_id, $title, $content ) ) { |
| | 225 | if ( apply_filters( 'bp_bypass_check_for_disallowed_keys', false, $user_id, $title, $content ) ) { |
| 214 | 226 | return true; |
| 215 | 227 | } |
| 216 | 228 | |
| … |
… |
function bp_core_check_for_blacklist( $user_id = 0, $title = '', $content = '',
|
| 293 | 305 | if ( 'bool' === $error_type ) { |
| 294 | 306 | return false; |
| 295 | 307 | } else { |
| 296 | | return new WP_Error( 'bp_moderation_blacklist_match', _x( 'You have posted an inappropriate word.', 'Comment blacklist', 'buddypress' ) ); |
| | 308 | return new WP_Error( 'bp_moderation_disallowed_key_match', _x( 'You have posted an inappropriate word.', 'Comment disallowed key', 'buddypress' ) ); |
| 297 | 309 | } |
| 298 | 310 | } |
| 299 | 311 | } |
diff --git src/bp-groups/screens/single/admin/group-settings.php src/bp-groups/screens/single/admin/group-settings.php
index f8deb8b3f..3e9788831 100644
|
|
|
function groups_screen_group_admin_settings() {
|
| 104 | 104 | */ |
| 105 | 105 | bp_core_load_template( apply_filters( 'groups_template_group_admin_settings', 'groups/single/home' ) ); |
| 106 | 106 | } |
| 107 | | add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); |
| 108 | | No newline at end of file |
| | 107 | add_action( 'bp_screens', 'groups_screen_group_admin_settings' ); |
diff --git src/class-buddypress.php src/class-buddypress.php
index d4610aad4..5464e5c4a 100644
|
|
|
class BuddyPress {
|
| 510 | 510 | require( $this->plugin_dir . 'bp-core/deprecated/3.0.php' ); |
| 511 | 511 | require( $this->plugin_dir . 'bp-core/deprecated/4.0.php' ); |
| 512 | 512 | require( $this->plugin_dir . 'bp-core/deprecated/6.0.php' ); |
| | 513 | require( $this->plugin_dir . 'bp-core/deprecated/7.0.php' ); |
| 513 | 514 | } |
| 514 | 515 | |
| 515 | 516 | // Load wp-cli module if PHP 5.4+. |