Skip to:
Content

BuddyPress.org

Opened 3 years ago

Closed 3 years ago

#8600 closed defect (bug) (fixed)

Default gravatar is not shown in messages templates

Reported by: konnektiv's profile konnektiv Owned by: imath's profile imath
Milestone: 10.0.0 Priority: normal
Severity: normal Version:
Component: Templates Keywords: needs-patch
Cc:

Description

The default gravatar option is not correctly used in messages templates. This is due to the fact that the URL is encoded like this:

www.gravatar.com/avatar/xxxx?s=28&r=g&d=mm

when it should be:

www.gravatar.com/avatar/xxxx?s=28&r=g&d=mm

This happens everywhere where the user avatar is added as backbone data e.g. here:

https://buddypress.trac.wordpress.org/browser/trunk/src/bp-templates/bp-nouveau/includes/messages/ajax.php#L474

If I add a call to html_entity_decode before the esc_url call this fixes the problem for me. However we fix this with a workaround in our project using js like this:

$(document).ajaxComplete(function () {
  $('img.avatar').each(function () {
    this.src = this.src.replace(/#038;/g, '');
  })
});

Change History (2)

#1 @imath
3 years ago

  • Component changed from (not sure) to Templates
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 10.0.0
  • Owner set to imath
  • Status changed from new to assigned

Thanks for your report @konnektiv 👍. Looking at it asap.

#2 @imath
3 years ago

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

In 13151:

Make sure the Nouveau Messages UI displays the real default Gravatar

Props konnektiv

Fixes #8600

Note: See TracTickets for help on using tickets.