Skip to:
Content

BuddyPress.org

Changeset 13844


Ignore:
Timestamp:
05/02/2024 12:43:50 PM (2 years ago)
Author:
imath
Message:

Use a more appropriate function to escape slugs

Props johndawson155

See #9143 (trunk)
Closes https://github.com/buddypress/buddypress/pull/277

Location:
trunk/src
Files:
10 edited

Legend:

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

    r13820 r13844  
    1818 */
    1919function bp_activity_slug() {
    20         echo esc_url( bp_get_activity_slug() );
     20        echo esc_attr( bp_get_activity_slug() );
    2121}
    2222        /**
     
    4747 */
    4848function bp_activity_root_slug() {
    49         echo esc_url( bp_get_activity_root_slug() );
     49        echo esc_attr( bp_get_activity_root_slug() );
    5050}
    5151        /**
  • trunk/src/bp-blogs/bp-blogs-template.php

    r13802 r13844  
    1818 */
    1919function bp_blogs_slug() {
    20         echo esc_url( bp_get_blogs_slug() );
     20        echo esc_attr( bp_get_blogs_slug() );
    2121}
    2222        /**
     
    4646 */
    4747function bp_blogs_root_slug() {
    48         echo esc_url( bp_get_blogs_root_slug() );
     48        echo esc_attr( bp_get_blogs_root_slug() );
    4949}
    5050        /**
     
    11861186                                // phpcs:ignore WordPress.Security.EscapeOutput
    11871187                                bp_get_form_field_attributes( 'blogname' ),
    1188                                 esc_url( bp_signup_get_subdomain_base() )
     1188                                esc_attr( bp_signup_get_subdomain_base() )
    11891189                        );
    11901190                }
  • trunk/src/bp-core/bp-core-template.php

    r13824 r13844  
    13341334 */
    13351335function bp_root_slug( $component = '' ) {
    1336         echo esc_url( bp_get_root_slug( $component ) );
     1336        echo esc_attr( bp_get_root_slug( $component ) );
    13371337}
    13381338        /**
     
    14641464 */
    14651465function bp_search_slug() {
    1466         echo esc_url( bp_get_search_slug() );
     1466        echo esc_attr( bp_get_search_slug() );
    14671467}
    14681468        /**
  • trunk/src/bp-friends/bp-friends-template.php

    r13804 r13844  
    1717 */
    1818function bp_friends_slug() {
    19         echo esc_url( bp_get_friends_slug() );
     19        echo esc_attr( bp_get_friends_slug() );
    2020}
    2121        /**
     
    4444 */
    4545function bp_friends_root_slug() {
    46         echo esc_url( bp_get_friends_root_slug() );
     46        echo esc_attr( bp_get_friends_root_slug() );
    4747}
    4848        /**
  • trunk/src/bp-groups/bp-groups-template.php

    r13808 r13844  
    1717 */
    1818function bp_groups_slug() {
    19         echo esc_url( bp_get_groups_slug() );
     19        echo esc_attr( bp_get_groups_slug() );
    2020}
    2121        /**
     
    4444 */
    4545function bp_groups_root_slug() {
    46         echo esc_url( bp_get_groups_root_slug() );
     46        echo esc_attr( bp_get_groups_root_slug() );
    4747}
    4848        /**
     
    7171 */
    7272function bp_groups_group_type_base() {
    73         echo esc_url( bp_get_groups_group_type_base() );
     73        echo esc_attr( bp_get_groups_group_type_base() );
    7474}
    7575        /**
     
    14311431 */
    14321432function bp_group_slug( $group = false ) {
    1433         echo esc_url( bp_get_group_slug( $group ) );
     1433        echo esc_attr( bp_get_group_slug( $group ) );
    14341434}
    14351435        /**
     
    45104510 */
    45114511function bp_group_pag_id() {
    4512         echo esc_url( bp_get_group_pag_id() );
     4512        echo esc_attr( bp_get_group_pag_id() );
    45134513}
    45144514        /**
     
    64876487 */
    64886488function bp_current_group_slug() {
    6489         echo esc_url( bp_get_current_group_slug() );
     6489        echo esc_attr( bp_get_current_group_slug() );
    64906490}
    64916491        /**
  • trunk/src/bp-members/bp-members-template.php

    r13799 r13844  
    1919 */
    2020function bp_profile_slug() {
    21         echo esc_url( bp_get_profile_slug() );
     21        echo esc_attr( bp_get_profile_slug() );
    2222}
    2323        /**
     
    4646 */
    4747function bp_members_slug() {
    48         echo esc_url( bp_get_members_slug() );
     48        echo esc_attr( bp_get_members_slug() );
    4949}
    5050        /**
     
    7373 */
    7474function bp_members_root_slug() {
    75         echo esc_url( bp_get_members_root_slug() );
     75        echo esc_attr( bp_get_members_root_slug() );
    7676}
    7777        /**
     
    100100 */
    101101function bp_members_member_type_base() {
    102         echo esc_url( bp_get_members_member_type_base() );
     102        echo esc_attr( bp_get_members_member_type_base() );
    103103}
    104104        /**
     
    216216 */
    217217function bp_signup_slug() {
    218         echo esc_url( bp_get_signup_slug() );
     218        echo esc_attr( bp_get_signup_slug() );
    219219}
    220220        /**
     
    249249 */
    250250function bp_activate_slug() {
    251         echo esc_url( bp_get_activate_slug() );
     251        echo esc_attr( bp_get_activate_slug() );
    252252}
    253253        /**
     
    282282 */
    283283function bp_members_invitations_slug() {
    284         echo esc_url( bp_get_members_invitations_slug() );
     284        echo esc_attr( bp_get_members_invitations_slug() );
    285285}
    286286        /**
     
    27382738 */
    27392739function bp_signup_subdomain_base() {
    2740         echo esc_url( bp_signup_get_subdomain_base() );
     2740        echo esc_attr( bp_signup_get_subdomain_base() );
    27412741}
    27422742        /**
  • trunk/src/bp-messages/bp-messages-template.php

    r13810 r13844  
    14631463 */
    14641464function bp_messages_slug() {
    1465         echo esc_url( bp_get_messages_slug() );
     1465        echo esc_attr( bp_get_messages_slug() );
    14661466}
    14671467        /**
  • trunk/src/bp-notifications/bp-notifications-template.php

    r13812 r13844  
    1717 */
    1818function bp_notifications_slug() {
    19         echo esc_url( bp_get_notifications_slug() );
     19        echo esc_attr( bp_get_notifications_slug() );
    2020}
    2121        /**
  • trunk/src/bp-settings/bp-settings-template.php

    r13814 r13844  
    1717 */
    1818function bp_settings_slug() {
    19         echo esc_url( bp_get_settings_slug() );
     19        echo esc_attr( bp_get_settings_slug() );
    2020}
    2121
     
    4545 */
    4646function bp_settings_root_slug() {
    47         echo esc_url( bp_get_settings_root_slug() );
     47        echo esc_attr( bp_get_settings_root_slug() );
    4848}
    4949
  • trunk/src/bp-xprofile/bp-xprofile-template.php

    r13806 r13844  
    331331 */
    332332function bp_the_profile_group_slug() {
    333         echo esc_url( bp_get_the_profile_group_slug() );
     333        echo esc_attr( bp_get_the_profile_group_slug() );
    334334}
    335335
Note: See TracChangeset for help on using the changeset viewer.