Making WordPress.org

Changeset 10921


Ignore:
Timestamp:
04/22/2021 01:45:47 AM (3 years ago)
Author:
dd32
Message:

BuddyPress.org: When redirecting older urls, don't try to redirect to a users profile when that user has been deleted (or is not attached to the activity entry).

This fixes various PHP Notices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/buddypress.org/public_html/wp-content/plugins/buddypress-org/extensions.php

    r10388 r10921  
    201201
    202202    $redirect = false;
     203    $has_user = isset( $activity->user_id, $activity->user_nicename, $activity->user_login );
     204
    203205    /* Redirect based on the type of activity */
    204206    if ( bp_is_active( 'groups' ) && $activity->component == $bp->groups->id ) {
    205         if ( $activity->user_id ) {
     207        if ( $has_user ) {
    206208            $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->name . '/' . $activity->id . '/';
    207209        }
    208     } else
     210    } else if ( $has_user ) {
    209211        $redirect = bp_core_get_user_domain( $activity->user_id, $activity->user_nicename, $activity->user_login ) . $bp->activity->name . '/' . $activity->id;
     212    }
    210213
    211214    return $redirect;
Note: See TracChangeset for help on using the changeset viewer.