Skip to:
Content

BuddyPress.org

Changeset 10683


Ignore:
Timestamp:
03/23/2016 05:12:36 PM (9 years ago)
Author:
r-a-y
Message:

Friends: Fix issue with friendship accepted email not being sent.

Previously, the $initiator_id variable in friends_notification_accepted_request()`
was a numeric string. The BP_Email_Recipient class can only handle
strict integers, which prevented friendship accepted emails from being
sent.

For 2.5-branch, this commit casts $initiator_id variable as an integer
to fix the immediate problem. A broader solution to audit all our access
methods and functions to ensure that numeric strings are cast as
integers will be implemented in a future release.

Fixes #6969 (2.5-branch).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/src/bp-friends/bp-friends-notifications.php

    r10587 r10683  
    6060 */
    6161function friends_notification_accepted_request( $friendship_id, $initiator_id, $friend_id ) {
    62     if ( 'no' == bp_get_user_meta( (int) $initiator_id, 'notification_friends_friendship_accepted', true ) ) {
     62    $initiator_id = (int) $initiator_id;
     63
     64    if ( 'no' == bp_get_user_meta( $initiator_id, 'notification_friends_friendship_accepted', true ) ) {
    6365        return;
    6466    }
Note: See TracChangeset for help on using the changeset viewer.