Skip to:
Content

BuddyPress.org

Opened 5 months ago

Closed 5 months ago

#9148 closed defect (bug) (fixed)

Mistake in XProfile Template Function when gettting Group Slug

Reported by: gingerbooch's profile gingerbooch Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 12.4.1
Component: Extended Profile Keywords:
Cc:

Description

Hi there, I'm actually testing updating from BuddyPress 11.4.0 to 12.4.1.

It seems there is a mistake in the xprofile template function when getting the profile group slug.

I think that the function "bp_the_profile_group_slug()" contains an error resulting in a wrong css class, which is an origin for custom broken css.

<?php
/**
 * Output the XProfile group slug.
 *
 * @since 1.1.0
 */
function bp_the_profile_group_slug() {
        echo esc_url( bp_get_the_profile_group_slug() );
}

With the default configuration, the code above should return "base", but the "esc_url()" function used here returns "http://base". I think it should be replaced by "esc_html()" :

<?php
/**
 * Output the XProfile group slug.
 *
 * @since 1.1.0
 */
function bp_the_profile_group_slug() {
        echo esc_html( bp_get_the_profile_group_slug() );
}

Is it possible to fix this please ?

Change History (5)

#1 @gingerbooch
5 months ago

An exemple can be seen when editting the Profile Base Group for a user, then checking the css path of the title element :

html body.xprofile.bp-user.my-account.my-profile.profile-edit.profile.edit.buddypress.bp-nouveau.buddypress-template-default.page.page-id-11.logged-in.admin-bar.no-customize-support.wp-embed-responsive.bm-messages-light div.wp-site-blocks main#wp--skip-link--target.wp-block-group.is-layout-flow.wp-block-group-is-layout-flow div.entry-content.wp-block-post-content.has-global-padding.is-layout-constrained.wp-block-post-content-is-layout-constrained div#buddypress.buddypress-wrap.twentytwentyfour.bp-dir-hori-nav div.bp-wrap div#item-body.item-body div.profile.edit form#profile-edit-form.standard-form.profile-edit.http://base

The last element.

#2 @imath
5 months ago

Hi @gingerbooch

Thanks a lot for your report, I believe it was fixed 4 days ago. We’ll soon publish a minor release.

See: https://buddypress.trac.wordpress.org/changeset/13844

#3 @gingerbooch
5 months ago

Hi @imath,

Thanks for your answer.
I will wait for that next update before pushing it into production 👍

#4 @gingerbooch
5 months ago

Hi @imath,

Thanks for the fix in 12.5.0.
I don't know how to close the ticket :D

GB

#5 @imath
5 months ago

  • Resolution set to fixed
  • Status changed from new to closed

Hi @gingerbooch

yw 👌

Note: See TracTickets for help on using tickets.