Skip to:
Content

BuddyPress.org

Changeset 5417


Ignore:
Timestamp:
11/29/2011 11:06:58 PM (12 years ago)
Author:
boonebgorges
Message:

Ensures links are constructed with trailing slash in groups, members, and messages components. See #3779

Location:
trunk
Files:
11 edited

Legend:

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

    r5302 r5417  
    130130                $text = sprintf( __( '%d accepted group membership requests', 'buddypress' ), (int)$total_items, $group->name );
    131131                $filter = 'bp_groups_multiple_membership_request_accepted_notification';
    132                 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
     132                $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
    133133
    134134                if ( 'string' == $format ) {
     
    166166                $text = sprintf( __( '%d rejected group membership requests', 'buddypress' ), (int)$total_items, $group->name );
    167167                $filter = 'bp_groups_multiple_membership_request_rejected_notification';
    168                 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '/?n=1';
     168                $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
    169169
    170170                if ( 'string' == $format ) {
     
    202202                $text = sprintf( __( 'You were promoted to an admin in %d groups', 'buddypress' ), (int)$total_items );
    203203                $filter = 'bp_groups_multiple_member_promoted_to_admin_notification';
    204                 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
     204                $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
    205205
    206206                if ( 'string' == $format ) {
     
    238238                $text = sprintf( __( 'You were promoted to a mod in %d groups', 'buddypress' ), (int)$total_items );
    239239                $filter = 'bp_groups_multiple_member_promoted_to_mod_notification';
    240                 $notification_link = bp_loggedin_user_domain() . bp_get_groups_slug() . '?n=1';
     240                $notification_link = trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) . '?n=1';
    241241
    242242                if ( 'string' == $format ) {
  • trunk/bp-groups/bp-groups-classes.php

    r5384 r5417  
    12801280        // Construct the admin edit tab for the new group extension
    12811281        if ( !empty( $this->enable_edit_item ) && !empty( $bp->is_item_admin ) ) {
    1282             add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' ), 10, 2 );
     1282            add_action( 'groups_admin_tabs', create_function( '$current, $group_slug', '$selected = ""; if ( "' . esc_attr( $this->admin_slug ) . '" == $current ) $selected = " class=\"current\""; echo "<li{$selected}><a href=\"' . trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/{$group_slug}/admin/' . esc_attr( $this->admin_slug ) ) . '\">' . esc_attr( $this->admin_name ) . '</a></li>";' ), 10, 2 );
    12831283
    12841284            // Catch the edit screen and forward it to the plugin template
  • trunk/bp-groups/bp-groups-notifications.php

    r5296 r5417  
    1919        $to = $ud->user_email;
    2020
    21         $group_link    = site_url( bp_get_groups_root_slug(). '/' . $group->slug );
     21        $group_link    = bp_get_group_permalink( $group );
    2222        $settings_slug = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
    2323        $settings_link = bp_core_get_user_domain( $user_id ) . $settings_slug . '/notifications/';
     
    223223        $settings_link = bp_core_get_user_domain( $invited_user_id ) . bp_get_settings_slug() . '/notifications/';
    224224        $invited_link = bp_core_get_user_domain( $invited_user_id );
    225         $invites_link = $invited_link . bp_get_groups_slug() . '/invites';
     225        $invites_link = trailingslashit( $invited_link . bp_get_groups_slug() . '/invites' );
    226226
    227227        // Set up and send the message
  • trunk/bp-groups/bp-groups-screens.php

    r5329 r5417  
    6161        }
    6262
    63         bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
     63        bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
    6464
    6565    } else if ( bp_is_action_variable( 'reject' ) && is_numeric( $group_id ) ) {
     
    7373            bp_core_add_message( __('Group invite rejected', 'buddypress') );
    7474
    75         bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() );
     75        bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' . bp_current_action() ) );
    7676    }
    7777
     
    791791                do_action( 'groups_group_deleted', $bp->groups->current_group->id );
    792792
    793                 bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() . '/' );
    794             }
    795 
    796             bp_core_redirect( bp_loggedin_user_domain() . bp_get_groups_slug() );
     793                bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
     794            }
     795
     796            bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_groups_slug() ) );
    797797        }
    798798
  • trunk/bp-groups/bp-groups-template.php

    r5379 r5417  
    456456            $group =& $groups_template->group;
    457457
    458         return apply_filters( 'bp_get_group_admin_permalink', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' );
     458        return apply_filters( 'bp_get_group_admin_permalink', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin' ) );
    459459    }
    460460
     
    12681268?>
    12691269    <?php if ( $bp->is_item_admin || $bp->is_item_mod ) { ?>
    1270         <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/edit-details"><?php _e( 'Details', 'buddypress' ); ?></a></li>
     1270        <li<?php if ( 'edit-details' == $current_tab || empty( $current_tab ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/edit-details' ) ?>"><?php _e( 'Details', 'buddypress' ); ?></a></li>
    12711271    <?php } ?>
    12721272
     
    12751275            return false;
    12761276    ?>
    1277     <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
     1277    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-settings' ) ?>"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    12781278
    12791279    <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
    1280         <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1280        <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/group-avatar' ) ?>"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
    12811281    <?php endif; ?>
    12821282
    1283     <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li>
     1283    <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/manage-members' ) ?>"><?php _e( 'Members', 'buddypress' ); ?></a></li>
    12841284
    12851285    <?php if ( $groups_template->group->status == 'private' ) : ?>
    1286         <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/membership-requests"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
     1286        <li<?php if ( 'membership-requests' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/membership-requests' ) ?>"><?php _e( 'Requests', 'buddypress' ); ?></a></li>
    12871287    <?php endif; ?>
    12881288
    12891289    <?php do_action( 'groups_admin_tabs', $current_tab, $group->slug ) ?>
    12901290
    1291     <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/delete-group"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
     1291    <li<?php if ( 'delete-group' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug . '/admin/delete-group' ) ?>"><?php _e( 'Delete', 'buddypress' ); ?></a></li>
    12921292<?php
    12931293}
     
    14071407            $group =& $groups_template->group;
    14081408
    1409         return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/accept/' . $group->id, 'groups_accept_invite' ) );
     1409        return apply_filters( 'bp_get_group_accept_invite_link', wp_nonce_url( trailingslashit( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/accept/' . $group->id ), 'groups_accept_invite' ) );
    14101410    }
    14111411
     
    14191419            $group =& $groups_template->group;
    14201420
    1421         return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/reject/' . $group->id, 'groups_reject_invite' ) );
     1421        return apply_filters( 'bp_get_group_reject_invite_link', wp_nonce_url( trailingslashit( $bp->loggedin_user->domain . bp_get_groups_slug() . '/invites/reject/' . $group->id ), 'groups_reject_invite' ) );
    14221422    }
    14231423
     
    20192019            $bp->action_variables[1] = array_shift( array_keys( $bp->groups->group_creation_steps ) );
    20202020
    2021         return apply_filters( 'bp_get_group_creation_form_action', bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) );
     2021        return apply_filters( 'bp_get_group_creation_form_action', trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create/step/' . bp_action_variable( 1 ) ) );
    20222022    }
    20232023
     
    22712271    global $create_group_step, $completed_to_step;
    22722272?>
    2273     <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-active"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
    2274     <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/recently-joined"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
    2275     <li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/most-popular"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
    2276     <li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/admin-of"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
    2277     <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/mod-of"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
    2278     <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo $bp->displayed_user->domain . bp_get_groups_slug() ?>/my-groups/alphabetically"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
     2273    <li<?php if ( !bp_action_variable( 0 ) || bp_is_action_variable( 'recently-active', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-active' ) ?>"><?php _e( 'Recently Active', 'buddypress' ) ?></a></li>
     2274    <li<?php if ( bp_is_action_variable( 'recently-joined', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/recently-joined' ) ?>"><?php _e( 'Recently Joined', 'buddypress' ) ?></a></li>
     2275    <li<?php if ( bp_is_action_variable( 'most-popular', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/most-popular' ) ?>"><?php _e( 'Most Popular', 'buddypress' ) ?></a></li>
     2276    <li<?php if ( bp_is_action_variable( 'admin-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/admin-of' ) ?>"><?php _e( 'Administrator Of', 'buddypress' ) ?></a></li>
     2277    <li<?php if ( bp_is_action_variable( 'mod-of', 0 ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/mod-of' ) ?>"><?php _e( 'Moderator Of', 'buddypress' ) ?></a></li>
     2278    <li<?php if ( bp_is_action_variable( 'alphabetically' ) ) : ?> class="current"<?php endif; ?>><a href="<?php echo trailingslashit( $bp->displayed_user->domain . bp_get_groups_slug() . '/my-groups/alphabetically' ) ?>"><?php _e( 'Alphabetically', 'buddypress' ) ?></a></li>
    22792279<?php
    22802280    do_action( 'groups_header_tabs' );
  • trunk/bp-members/bp-members-signup.php

    r5345 r5417  
    2424    if ( is_user_logged_in() ) {
    2525        if ( bp_is_component_front_page( 'register' ) )
    26             $redirect_to = bp_get_root_domain() . '/' . bp_get_members_root_slug();
     26            $redirect_to = trailingslashit( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
    2727        else
    2828            $redirect_to = bp_get_root_domain();
  • trunk/bp-members/bp-members-template.php

    r5379 r5417  
    759759            $link = str_replace( $bp->loggedin_user->domain, $bp->displayed_user->domain, $user_nav_item['link'] );
    760760        else
    761             $link = $bp->displayed_user->domain . $user_nav_item['link'];
     761            $link = trailingslashit( $bp->displayed_user->domain . $user_nav_item['link'] );
    762762
    763763        echo apply_filters_ref_array( 'bp_get_displayed_user_nav_' . $user_nav_item['css_id'], array( '<li id="' . $user_nav_item['css_id'] . '-personal-li" ' . $selected . '><a id="user-' . $user_nav_item['css_id'] . '" href="' . $link . '">' . $user_nav_item['name'] . '</a></li>', &$user_nav_item ) );
  • trunk/bp-messages/bp-messages-actions.php

    r5329 r5417  
    1818
    1919    if ( !$thread_id || !messages_is_valid_thread( $thread_id ) || ( !messages_check_thread_access( $thread_id ) && !bp_current_user_can( 'bp_moderate' ) ) )
    20         bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() );
     20        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() ) );
    2121
    2222    // Check if a new reply has been submitted
     
    5353        'position'        => 40,
    5454        'user_has_access' => bp_is_my_profile(),
    55         'link'            => bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id
     55        'link'            => trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/view/' . (int) $thread_id )
    5656    ) );
    5757
     
    6969
    7070    if ( !$thread_id || !is_numeric( $thread_id ) || !messages_check_thread_access( $thread_id ) ) {
    71         bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
     71        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
    7272    } else {
    7373        if ( !check_admin_referer( 'messages_delete_thread' ) )
     
    8080            bp_core_add_message( __('Message deleted.', 'buddypress') );
    8181        }
    82         bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
     82        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
    8383    }
    8484}
     
    9494
    9595    if ( !$thread_ids || !messages_check_thread_access( $thread_ids ) ) {
    96         bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
     96        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
    9797    } else {
    9898        if ( !check_admin_referer( 'messages_delete_thread' ) )
     
    104104            bp_core_add_message( __('Messages deleted.', 'buddypress') );
    105105
    106         bp_core_redirect( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() );
     106        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action() ) );
    107107    }
    108108}
  • trunk/bp-messages/bp-messages-functions.php

    r5329 r5417  
    234234
    235235    if ( 'new_message' == $action ) {
    236         $link  = bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox';
     236        $link  = trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/inbox' );
    237237        $title = __( 'Inbox', 'buddypress' );
    238238
  • trunk/bp-messages/bp-messages-screens.php

    r5329 r5417  
    115115            }
    116116        }
    117         bp_core_redirect( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' );
     117        bp_core_redirect( trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() . '/notices' ) );
    118118    }
    119119
  • trunk/bp-messages/bp-messages-template.php

    r5329 r5417  
    255255    function bp_get_message_thread_delete_link() {
    256256        global $messages_template, $bp;
    257         return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id, 'messages_delete_thread' ) );
     257        return apply_filters( 'bp_get_message_thread_delete_link', wp_nonce_url( trailingslashit( $bp->loggedin_user->domain . $bp->messages->slug . '/' . $bp->current_action . '/delete/' . $messages_template->thread->thread_id ), 'messages_delete_thread' ) );
    258258    }
    259259
     
    480480
    481481        if ( 1 == (int)$messages_template->thread->is_active ) {
    482             $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id, 'messages_deactivate_notice' );
     482            $link = wp_nonce_url( trailingslashit( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/deactivate/' . $messages_template->thread->id ), 'messages_deactivate_notice' );
    483483        } else {
    484             $link = wp_nonce_url( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id, 'messages_activate_notice' );
     484            $link = wp_nonce_url( trailingslashit( $bp->loggedin_user->domain . $bp->messages->slug . '/notices/activate/' . $messages_template->thread->id ), 'messages_activate_notice' );
    485485        }
    486486        return apply_filters( 'bp_get_message_activate_deactivate_link', $link );
Note: See TracChangeset for help on using the changeset viewer.