Skip to:
Content

BuddyPress.org

Ticket #8135: 8135.patch

File 8135.patch, 3.0 KB (added by imath, 5 years ago)
  • src/bp-friends/classes/class-bp-friends-friendship.php

    diff --git src/bp-friends/classes/class-bp-friends-friendship.php src/bp-friends/classes/class-bp-friends-friendship.php
    index 761033541..9fa625cc7 100644
    class BP_Friends_Friendship { 
    197197                 *
    198198                 * @param BP_Friends_Friendship $value Current friendship request object.
    199199                 */
    200                 do_action( 'friends_friendship_after_save', array( &$this ) );
     200                do_action_ref_array( 'friends_friendship_after_save', array( &$this ) );
    201201
    202202                return $result;
    203203        }
    class BP_Friends_Friendship { 
    614614         *
    615615         * @since 3.0.0
    616616         *
    617          * @param int $user_id                          The ID of the primary user for whom we want 
     617         * @param int $user_id                          The ID of the primary user for whom we want
    618618         *                                              to check friendships statuses.
    619          * @param int|array|string $possible_friend_ids The IDs of the one or more users 
     619         * @param int|array|string $possible_friend_ids The IDs of the one or more users
    620620         *                                              to check friendship status with primary user.
    621621         * @return null
    622622         */
    class BP_Friends_Friendship { 
    628628                $fetch = array();
    629629                foreach ( $possible_friend_ids as $friend_id ) {
    630630                        // Check for cached items in both friendship directions.
    631                         if ( false === bp_core_get_incremented_cache( $user_id . ':' . $friend_id, 'bp_friends' ) 
     631                        if ( false === bp_core_get_incremented_cache( $user_id . ':' . $friend_id, 'bp_friends' )
    632632                                || false === bp_core_get_incremented_cache( $friend_id . ':' . $user_id, 'bp_friends' ) ) {
    633633                                $fetch[] = $friend_id;
    634634                        }
    class BP_Friends_Friendship { 
    649649                        if ( 1 === (int) $friendship->is_confirmed ) {
    650650                                $status_initiator = $status_friend = 'is_friend';
    651651                        } else {
    652                                 $status_initiator = 'pending'; 
     652                                $status_initiator = 'pending';
    653653                                $status_friend    = 'awaiting_response';
    654654                        }
    655655                        bp_core_set_incremented_cache( $initiator_user_id . ':' . $friend_user_id, 'bp_friends', $status_initiator );
  • tests/phpunit/testcases/members/template.php

    diff --git tests/phpunit/testcases/members/template.php tests/phpunit/testcases/members/template.php
    index 13c53dccd..f9aed7d2d 100644
    class BP_Tests_Members_Template extends BP_UnitTestCase { 
    2727        /**
    2828         * @ticket BP5898
    2929         * @group bp_has_members
     30         * @group imath
    3031         */
    3132        public function test_bp_has_members_search_pagination_with_spaces() {
    3233                $u1 = self::factory()->user->create( array( 'display_name' => '~ tilde u1' ) );
    class BP_Tests_Members_Template extends BP_UnitTestCase { 
    4243
    4344                bp_has_members( $template_args );
    4445
    45                 preg_match( '/&members_search=(.*)\'/', $members_template->pag_links, $matches );
     46                preg_match( '/&members_search=(.*)(\'|\")/', $members_template->pag_links, $matches );
    4647
    4748                $this->assertEquals( urldecode( $matches[1] ), urldecode( $template_args['search_terms'] ) );
    4849