Skip to:
Content

BuddyPress.org

Opened 17 years ago

Closed 16 years ago

#2288 closed defect (bug) (fixed)

bp_core_fetch_avatar_filter() doesn't support email address in $user parameter [HAS-PATCH]

Reported by: rvenable Owned by: apeatling
Priority: normal Milestone: 1.5
Component: Core Version:
Severity: Keywords: has-patch
Cc:

Description

bp_core_fetch_avatar_filter() is used as a filter on the WP get_avatar() function. The 'get_avatar' filter passes a variable $id_or_email (see ​pluggable.php, line 1631) which becomes the $user parameter of bp_core_fetch_avatar_filter(). However, $id_or_email can either be a user ID, a user object, or a user email address, but bp_core_fetch_avatar_filter() does not support the email address.

This breaks some themes that pass a user email address to get_avatar() for comments, causing the comments to display the avatar for the blog post author rather than the comment author.

This cannot be demonstrated on testbp.org because it is no longer running WPMU.

Attachments (2)

avatar_fix.diff​ (613 bytes ) - added by rvenable 17 years ago.
user_by_email.patch​ (422 bytes ) - added by johnjamesjacoby 16 years ago.
The only reason not to do this, is for the potential DB hits in the event the user_id isn't cached. I imagine that's why this was left out. Assigned to Andy for review.

Download all attachments as: .zip

Change History (6)

@rvenable
17 years ago

#1 @DJPaul
16 years ago

  • Priority minor → normal

@johnjamesjacoby
16 years ago

The only reason not to do this, is for the potential DB hits in the event the user_id isn't cached. I imagine that's why this was left out. Assigned to Andy for review.

#2 @johnjamesjacoby
16 years ago

  • Owner set to apeatling
  • Status new → assigned

#3 @johnjamesjacoby
16 years ago

  • Milestone 1.2.4 → 1.3

Bumping to 1.3 for future review.

#4 @johnjamesjacoby
16 years ago

  • Resolution → fixed
  • Status assigned → closed

(In [3035]) Fixes #2288, #2183, and #2426.

Note: See TracTickets for help on using tickets.