Skip to:
Content

BuddyPress.org

Changeset 12647


Ignore:
Timestamp:
05/07/2020 07:23:00 PM (5 years ago)
Author:
r-a-y
Message:

Do not use sanitize_file_name() when passing integer values.

Fixes an array offset notice due to the addition of seems_utf8() in
sanitize_file_name() for WordPress 5.4.1:
https://core.trac.wordpress.org/changeset/47643

Props mercime, r-a-y.

Fixes #8288.

Location:
trunk/src
Files:
6 edited

Legend:

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

    r12590 r12647  
    43594359
    43604360    $template_names = array(
    4361         'groups/single/front-id-'     . sanitize_file_name( $group->id )    . '.php',
     4361        'groups/single/front-id-'     . (int) $group->id . '.php',
    43624362        'groups/single/front-slug-'   . sanitize_file_name( $group->slug )   . '.php',
    43634363    );
  • trunk/src/bp-groups/classes/class-bp-groups-theme-compat.php

    r11151 r12647  
    224224         */
    225225        $new_templates = apply_filters( 'bp_template_hierarchy_groups_single_item', array(
    226             'groups/single/index-id-'     . sanitize_file_name( bp_get_current_group_id() )   . '.php',
     226            'groups/single/index-id-'     . (int) bp_get_current_group_id()                   . '.php',
    227227            'groups/single/index-slug-'   . sanitize_file_name( bp_get_current_group_slug() ) . '.php',
    228228            'groups/single/index-action-' . sanitize_file_name( bp_current_action() )         . '.php',
  • trunk/src/bp-members/bp-members-template.php

    r12591 r12647  
    14241424    // Init the hierarchy
    14251425    $template_names = array(
    1426         'members/single/front-id-' . sanitize_file_name( $displayed_user->id ) . '.php',
     1426        'members/single/front-id-' . (int) $displayed_user->id . '.php',
    14271427        'members/single/front-nicename-' . sanitize_file_name( $displayed_user->userdata->user_nicename ) . '.php',
    14281428    );
  • trunk/src/bp-members/classes/class-bp-members-theme-compat.php

    r11748 r12647  
    171171         */
    172172        $new_templates = apply_filters( 'bp_template_hierarchy_members_single_item', array(
    173             'members/single/index-id-'        . sanitize_file_name( bp_displayed_user_id() ) . '.php',
     173            'members/single/index-id-'        . (int) bp_displayed_user_id()                . '.php',
    174174            'members/single/index-nicename-'  . sanitize_file_name( $user_nicename )         . '.php',
    175175            'members/single/index-action-'    . sanitize_file_name( bp_current_action() )    . '.php',
  • trunk/src/bp-templates/bp-nouveau/includes/groups/functions.php

    r12595 r12647  
    941941    if ( ! isset( $bp_nouveau->groups->current_group_hierarchy ) ) {
    942942        $bp_nouveau->groups->current_group_hierarchy = array(
    943             'groups/single/%s-id-' . sanitize_file_name( $current_group->id ) . '.php',
     943            'groups/single/%s-id-' . (int) $current_group->id                    . '.php',
    944944            'groups/single/%s-slug-' . sanitize_file_name( $current_group->slug ) . '.php',
    945945        );
  • trunk/src/bp-templates/bp-nouveau/includes/members/functions.php

    r12570 r12647  
    265265    if ( ! isset( $bp_nouveau->members->displayed_user_hierarchy ) ) {
    266266        $bp_nouveau->members->displayed_user_hierarchy = array(
    267             'members/single/%s-id-' . sanitize_file_name( $displayed_user->id ) . '.php',
     267            'members/single/%s-id-' . (int) $displayed_user->id . '.php',
    268268            'members/single/%s-nicename-' . sanitize_file_name( $displayed_user->userdata->user_nicename ) . '.php',
    269269        );
Note: See TracChangeset for help on using the changeset viewer.