Skip to:
Content

Changeset 11598


Ignore:
Timestamp:
06/21/2017 09:03:42 PM (12 months ago)
Author:
r-a-y
Message:

Audit template link functions to use trailingslashit() where necessary.

Particularly, fixes issues on LightSpeed installs.

Props allianse, r-a-y.

Fixes #7448.

Location:
trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r11564 r11598  
    20912091     */
    20922092    function bp_get_activity_comment_delete_link() {
    2093         $link = wp_nonce_url( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
     2093        $link = wp_nonce_url( trailingslashit( bp_get_activity_directory_permalink() . 'delete/' . bp_get_activity_comment_id() ) . '?cid=' . bp_get_activity_comment_id(), 'bp_activity_delete_link' );
    20942094
    20952095        /**
  • trunk/src/bp-friends/bp-friends-template.php

    r11447 r11598  
    564564         * @param int    $friendship_id ID of the friendship.
    565565         */
    566         return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ), $friendship_id );
     566        return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id ), 'friends_accept_friendship' ), $friendship_id );
    567567    }
    568568
     
    599599         * @param int    $friendship_id ID of the friendship.
    600600         */
    601         return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id, 'friends_reject_friendship' ), $friendship_id );
     601        return apply_filters( 'bp_get_friend_reject_request_link', wp_nonce_url( trailingslashit( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/reject/' . $friendship_id ), 'friends_reject_friendship' ), $friendship_id );
    602602    }
    603603
  • trunk/src/bp-groups/bp-groups-template.php

    r11595 r11598  
    18011801         * @param object $group Group object.
    18021802         */
    1803         return apply_filters( 'bp_get_group_all_members_permalink', bp_get_group_permalink( $group ) . 'members', $group );
     1803        return apply_filters( 'bp_get_group_all_members_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'members' ), $group );
    18041804    }
    18051805
     
    20612061         * @param object $group Group object.
    20622062         */
    2063         return apply_filters( 'bp_get_group_forum_permalink', bp_get_group_permalink( $group ) . 'forum', $group );
     2063        return apply_filters( 'bp_get_group_forum_permalink', trailingslashit( bp_get_group_permalink( $group ) . 'forum' ), $group );
    20642064    }
    20652065
     
    26212621         * @param string $value URL to use for promoting a user to moderator.
    26222622         */
    2623         return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id, 'groups_promote_member' ) );
     2623        return apply_filters( 'bp_get_group_member_promote_mod_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/mod/' . $user_id ), 'groups_promote_member' ) );
    26242624    }
    26252625
     
    26642664         * @param string $value URL to use for promoting a user to admin.
    26652665         */
    2666         return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id, 'groups_promote_member' ) );
     2666        return apply_filters( 'bp_get_group_member_promote_admin_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/promote/admin/' . $user_id ), 'groups_promote_member' ) );
    26672667    }
    26682668
     
    27142714         * @param object $group Group object.
    27152715         */
    2716         return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id, 'groups_demote_member' ), $group );
     2716        return apply_filters( 'bp_get_group_member_demote_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/demote/' . $user_id ), 'groups_demote_member' ), $group );
    27172717    }
    27182718
     
    27582758         * @param string $value URL to use for banning a member.
    27592759         */
    2760         return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id, 'groups_ban_member' ) );
     2760        return apply_filters( 'bp_get_group_member_ban_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/ban/' . $user_id ), 'groups_ban_member' ) );
    27612761    }
    27622762
     
    28062806         * @param string $value URL to use for unbanning a member.
    28072807         */
    2808         return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id, 'groups_unban_member' ) );
     2808        return apply_filters( 'bp_get_group_member_unban_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/unban/' . $user_id ), 'groups_unban_member' ) );
    28092809    }
    28102810
     
    28522852         * @param object $group Group object.
    28532853         */
    2854         return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id, 'groups_remove_member' ), $group );
     2854        return apply_filters( 'bp_get_group_member_remove_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'admin/manage-members/remove/' . $user_id ), 'groups_remove_member' ), $group );
    28552855    }
    28562856
     
    29792979         * @param object $group Group object.
    29802980         */
    2981         return apply_filters( 'bp_group_form_action', bp_get_group_permalink( $group ) . $page, $group );
     2981        return apply_filters( 'bp_group_form_action', trailingslashit( bp_get_group_permalink( $group ) . $page ), $group );
    29822982    }
    29832983
     
    30223022         * @param object $group Group object.
    30233023         */
    3024         return apply_filters( 'bp_group_admin_form_action', bp_get_group_permalink( $group ) . 'admin/' . $page, $group );
     3024        return apply_filters( 'bp_group_admin_form_action', trailingslashit( bp_get_group_permalink( $group ) . 'admin/' . $page ), $group );
    30253025    }
    30263026
     
    32843284         * @param object $group Group object.
    32853285         */
    3286         return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group/yes', 'groups_leave_group' ), $group );
     3286        return apply_filters( 'bp_group_leave_confirm_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'leave-group/yes' ), 'groups_leave_group' ), $group );
    32873287    }
    32883288
     
    33563356         * @param object $group Group object.
    33573357         */
    3358         return apply_filters( 'bp_group_send_invite_form_action', bp_get_group_permalink( $group ) . 'send-invites/send', $group );
     3358        return apply_filters( 'bp_group_send_invite_form_action', trailingslashit( bp_get_group_permalink( $group ) . 'send-invites/send' ), $group );
    33593359    }
    33603360
     
    34953495                'wrapper_class'     => 'group-button ' . $group->status,
    34963496                'wrapper_id'        => 'groupbutton-' . $group->id,
    3497                 'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'leave-group', 'groups_leave_group' ),
     3497                'link_href'         => wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'leave-group' ), 'groups_leave_group' ),
    34983498                'link_text'         => __( 'Leave Group', 'buddypress' ),
    34993499                'link_class'        => 'group-button leave-group',
     
    35163516                        'wrapper_class'     => 'group-button ' . $group->status,
    35173517                        'wrapper_id'        => 'groupbutton-' . $group->id,
    3518                         'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'join', 'groups_join_group' ),
     3518                        'link_href'         => wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'join' ), 'groups_join_group' ),
    35193519                        'link_text'         => __( 'Join Group', 'buddypress' ),
    35203520                        'link_class'        => 'group-button join-group',
     
    35643564                            'wrapper_class'     => 'group-button ' . $group->status,
    35653565                            'wrapper_id'        => 'groupbutton-' . $group->id,
    3566                             'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ),
     3566                            'link_href'         => wp_nonce_url( trailingslashit( bp_get_group_permalink( $group ) . 'request-membership' ), 'groups_request_membership' ),
    35673567                            'link_text'         => __( 'Request Membership', 'buddypress' ),
    35683568                            'link_class'        => 'group-button request-membership',
     
    55175517         * @param string $value URL to delete the group avatar.
    55185518         */
    5519         return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-avatar/delete', 'bp_group_avatar_delete' ) );
     5519        return apply_filters( 'bp_get_group_avatar_delete_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( $bp->groups->current_group ) . 'admin/group-avatar/delete' ), 'bp_group_avatar_delete' ) );
    55205520    }
    55215521
     
    56485648         * @param string $value URL to use to reject a membership request.
    56495649         */
    5650         return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/reject/' . $requests_template->request->membership_id, 'groups_reject_membership_request' ) );
     5650        return apply_filters( 'bp_get_group_request_reject_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/reject/' . $requests_template->request->membership_id ), 'groups_reject_membership_request' ) );
    56515651    }
    56525652
     
    56725672         * @param string $value URL to use to accept a membership request.
    56735673         */
    5674         return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/accept/' . $requests_template->request->membership_id, 'groups_accept_membership_request' ) );
     5674        return apply_filters( 'bp_get_group_request_accept_link', wp_nonce_url( trailingslashit( bp_get_group_permalink( groups_get_current_group() ) . 'admin/membership-requests/accept/' . $requests_template->request->membership_id ), 'groups_accept_membership_request' ) );
    56755675    }
    56765676
     
    59945994            $uninvite_url = bp_get_groups_directory_permalink() . 'create/step/group-invites/?user_id=' . $user_id;
    59955995        } else {
    5996             $uninvite_url = bp_get_group_permalink( groups_get_current_group() ) . 'send-invites/remove/' . $user_id;
     5996            $uninvite_url = trailingslashit( bp_get_group_permalink( groups_get_current_group() ) . 'send-invites/remove/' . $user_id );
    59975997        }
    59985998
  • trunk/src/bp-messages/bp-messages-template.php

    r11582 r11598  
    11641164         * @param string $value Text indicating action being executed.
    11651165         */
    1166         return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( bp_displayed_user_domain() . bp_get_messages_slug() . '/notices/delete/' . $messages_template->thread->id, 'messages_delete_thread' ) );
     1166        return apply_filters( 'bp_get_message_notice_delete_link', wp_nonce_url( trailingslashit( bp_displayed_user_domain() . bp_get_messages_slug() . '/notices/delete/' . $messages_template->thread->id ), 'messages_delete_thread' ) );
    11671167    }
    11681168
Note: See TracChangeset for help on using the changeset viewer.