Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

#8600 closed defect (bug) (fixed)

Default gravatar is not shown in messages templates

Reported by: konnektiv Owned by: imath
Priority: normal Milestone: 10.0.0
Component: Templates Version:
Severity: normal 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
5 years ago

  • Component (not sure)Templates
  • Keywords needs-patch added
  • Milestone Awaiting Review10.0.0
  • Owner set to imath
  • Status newassigned

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

#2 @imath
5 years ago

  • Resolutionfixed
  • Status assignedclosed

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.