Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2010 02:50:47 PM (15 years ago)
Author:
apeatling
Message:

Added missing pre_save filters to activity saving. Fixed bug where a user could leave/join a group quickly multiple times and flood the activity stream.

File:
1 edited

Legend:

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

    r2644 r2675  
    4747        global $wpdb, $bp, $current_user;
    4848
    49         do_action( 'bp_activity_before_save', $this );
     49        do_action( 'bp_activity_before_save', &$this );
     50
     51        $this->id = apply_filters( 'bp_activity_id_before_save', $this->id, &$this );
     52        $this->item_id = apply_filters( 'bp_activity_item_id_before_save', $this->item_id, &$this );
     53        $this->secondary_item_id = apply_filters( 'bp_activity_secondary_item_id_before_save', $this->secondary_item_id, &$this );
     54        $this->user_id = apply_filters( 'bp_activity_user_id_before_save', $this->user_id, &$this );
     55        $this->primary_link = apply_filters( 'bp_activity_primary_link_before_save', $this->primary_link, &$this );
     56        $this->component = apply_filters( 'bp_activity_component_before_save', $this->component, &$this );
     57        $this->type = apply_filters( 'bp_activity_type_before_save', $this->type, &$this );
     58        $this->action = apply_filters( 'bp_activity_action_before_save', $this->action, &$this );
     59        $this->content = apply_filters( 'bp_activity_content_before_save', $this->content, &$this );
     60        $this->date_recorded = apply_filters( 'bp_activity_date_recorded_before_save', $this->date_recorded, &$this );
     61        $this->hide_sitewide = apply_filters( 'bp_activity_hide_sitewide_before_save', $this->hide_sitewide, &$this );
     62        $this->mptt_left = apply_filters( 'bp_activity_mptt_left_before_save', $this->mptt_left, &$this );
     63        $this->mptt_right = apply_filters( 'bp_activity_mptt_right_before_save', $this->mptt_right, &$this );
    5064
    5165        if ( !$this->component || !$this->type )
     
    6781            $this->id = $wpdb->insert_id;
    6882
    69         do_action( 'bp_activity_after_save', $this );
     83        do_action( 'bp_activity_after_save', &$this );
    7084        return true;
    7185    }
     
    280294            return false;
    281295
     296        error_log( $where_sql );
     297
    282298        /* Fetch the activity IDs so we can delete any comments for this activity item */
    283299        $activity_ids = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->activity->table_name} {$where_sql}" ) );
Note: See TracChangeset for help on using the changeset viewer.