Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/25/2011 12:29:19 AM (15 years ago)
Author:
boonebgorges
Message:

Global/slug audit in Core and Activity components. Fixes #3325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-actions.php

    r4819 r4847  
    2323
    2424    // No activity to display
    25     if ( empty( $bp->action_variables[0] ) || !is_numeric( $bp->action_variables[0] ) )
     25    if ( !bp_action_variable( 0 ) || !is_numeric( bp_action_variable( 0 ) ) )
    2626        return false;
    2727
    2828    // Get the activity details
    29     $activity = bp_activity_get_specific( array( 'activity_ids' => $bp->action_variables[0], 'show_hidden' => true ) );
     29    $activity = bp_activity_get_specific( array( 'activity_ids' => bp_action_variable( 0 ), 'show_hidden' => true ) );
    3030
    3131    // 404 if activity does not exist
     
    8888        return false;
    8989
    90     if ( empty( $activity_id ) && !empty( $bp->action_variables[0] ) && is_numeric( $bp->action_variables[0] ) )
    91         $activity_id = (int) $bp->action_variables[0];
     90    if ( empty( $activity_id ) && bp_action_variable( 0 ) )
     91        $activity_id = (int) bp_action_variable( 0 );
    9292
    9393    // Not viewing a specific activity item
     
    212212    check_admin_referer( 'mark_favorite' );
    213213
    214     if ( bp_activity_add_user_favorite( $bp->action_variables[0] ) )
     214    if ( bp_activity_add_user_favorite( bp_action_variable( 0 ) ) )
    215215        bp_core_add_message( __( 'Activity marked as favorite.', 'buddypress' ) );
    216216    else
    217217        bp_core_add_message( __( 'There was an error marking that activity as a favorite, please try again.', 'buddypress' ), 'error' );
    218218
    219     bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0] );
     219    bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
    220220}
    221221add_action( 'bp_actions', 'bp_activity_action_mark_favorite' );
     
    230230    check_admin_referer( 'unmark_favorite' );
    231231
    232     if ( bp_activity_remove_user_favorite( $bp->action_variables[0] ) )
     232    if ( bp_activity_remove_user_favorite( bp_action_variable( 0 ) ) )
    233233        bp_core_add_message( __( 'Activity removed as favorite.', 'buddypress' ) );
    234234    else
    235235        bp_core_add_message( __( 'There was an error removing that activity as a favorite, please try again.', 'buddypress' ), 'error' );
    236236
    237     bp_core_redirect( wp_get_referer() . '#activity-' . $bp->action_variables[0] );
     237    bp_core_redirect( wp_get_referer() . '#activity-' . bp_action_variable( 0 ) );
    238238}
    239239add_action( 'bp_actions', 'bp_activity_action_remove_favorite' );
     
    270270    global $bp, $wp_query;
    271271
    272     if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     272    if ( !bp_is_active( 'friends' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_friends_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
    273273        return false;
    274274
     
    284284    global $bp, $wp_query;
    285285
    286     if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     286    if ( !bp_is_active( 'groups' ) || !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( bp_get_groups_slug() ) || !bp_is_action_variable( 'feed', 0 ) )
    287287        return false;
    288288
     
    298298    global $bp, $wp_query;
    299299
    300     if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     300    if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'mentions' ) || !bp_is_action_variable( 'feed', 0 ) )
    301301        return false;
    302302
     
    312312    global $bp, $wp_query;
    313313
    314     if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
     314    if ( !bp_is_current_component( 'activity' ) || !bp_is_user() || !bp_is_current_action( 'favorites' ) || !bp_is_action_variable( 'feed', 0 ) )
    315315        return false;
    316316
Note: See TracChangeset for help on using the changeset viewer.