Skip to:
Content

BuddyPress.org

Ticket #8392: 8392.patch

File 8392.patch, 1.5 KB (added by imath, 4 years ago)
  • src/bp-core/classes/class-bp-invitation-manager.php

    diff --git src/bp-core/classes/class-bp-invitation-manager.php src/bp-core/classes/class-bp-invitation-manager.php
    index e1bc7748e..a8bb047ce 100644
    abstract class BP_Invitation_Manager { 
    611611         * @param int $id The ID of the invitation to mark as sent.
    612612         * @return bool True on success, false on failure.
    613613         */
    614         abstract public function run_acceptance_action( $type = 'invite', $r  );
     614        abstract public function run_acceptance_action( $type, $r  );
    615615
    616616        /**
    617617         * Mark invitation as accepted by invitation ID.
  • src/bp-groups/classes/class-bp-groups-invitation-manager.php

    diff --git src/bp-groups/classes/class-bp-groups-invitation-manager.php src/bp-groups/classes/class-bp-groups-invitation-manager.php
    index d22cd0977..76d4e13c7 100644
    class BP_Groups_Invitation_Manager extends BP_Invitation_Manager { 
    6767         * @param array  $r    Parameters that describe the invitation being accepted.
    6868         * @return bool True on success, false on failure.
    6969         */
    70         public function run_acceptance_action( $type = 'invite', $r  ) {
     70        public function run_acceptance_action( $type, $r ) {
     71                if ( ! $type || ! in_array( $type, array( 'request', 'invite' ), true ) ) {
     72                        return false;
     73                }
     74
    7175                // If the user is already a member (because BP at one point allowed two invitations to
    7276                // slip through), return early.
    7377                if ( groups_is_user_member( $r['user_id'], $r['item_id'] ) ) {