Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/25/2011 12:11:32 AM (14 years ago)
Author:
boonebgorges
Message:

Global/slug audit in Friends component. See #3325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-screens.php

    r4822 r4845  
    2121
    2222function friends_screen_requests() {
    23     global $bp;
    24 
    25     if ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'accept' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) {
     23    if ( bp_is_action_variable( 'accept', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
    2624        // Check the nonce
    2725        check_admin_referer( 'friends_accept_friendship' );
    2826
    29         if ( friends_accept_friendship( $bp->action_variables[1] ) )
     27        if ( friends_accept_friendship( bp_action_variable( 1 ) ) )
    3028            bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) );
    3129        else
    3230            bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' );
    3331
    34         bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
     32        bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() );
    3533
    36     } elseif ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'reject' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) {
     34    } elseif ( bp_is_action_variable( 'reject', 0 ) && is_numeric( bp_action_variable( 1 ) ) ) {
    3735        // Check the nonce
    3836        check_admin_referer( 'friends_reject_friendship' );
    3937
    40         if ( friends_reject_friendship( $bp->action_variables[1] ) )
     38        if ( friends_reject_friendship( bp_action_variable( 1 ) ) )
    4139            bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) );
    4240        else
    4341            bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
    4442
    45         bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
     43        bp_core_redirect( bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action() );
    4644    }
    4745
     
    4947
    5048    if ( isset( $_GET['new'] ) )
    51         bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->friends->id, 'friendship_request' );
     49        bp_core_delete_notifications_by_type( bp_loggedin_user_id(), 'friends', 'friendship_request' );
    5250
    5351    bp_core_load_template( apply_filters( 'friends_template_requests', 'members/single/home' ) );
Note: See TracChangeset for help on using the changeset viewer.