Opened 15 years ago
Closed 14 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 |
---|---|---|---|
Milestone: | 1.5 | Priority: | normal |
Severity: | Version: | ||
Component: | Core | 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.
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.