[buddypress-trac] [BuddyPress Trac] #5319: Prevent friend POST request from member to himself

buddypress-trac noreply at wordpress.org
Wed Mar 26 23:49:04 UTC 2014


#5319: Prevent friend POST request from member to himself
-------------------------+--------------------
 Reporter:  megainfo     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  low          |   Milestone:  2.0
Component:  Friends      |     Version:  1.9.1
 Severity:  minor        |  Resolution:
 Keywords:  has-patch    |
-------------------------+--------------------
Changes (by r-a-y):

 * keywords:  2nd-opinion needs-refresh => has-patch


Comment:

 Attached patch checks if the initiator and the pending friend to see if
 they are the same.  If they are the same, we bail.

 Patch also fixes a logic issue with how `friends_add_friend()` checks if
 the two users are already friends.  We need to use the
 `friends_check_friendship()` to actually check if two users are friends or
 not.  Instantiating a new BP_Friends_Friendship object does not do
 anything.

 Just wanted some feedback on the latter before I commit.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5319#comment:7>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list