[buddypress-trac] [BuddyPress] #4092: Buddypress will show wrong user avatars if they contain -bpfull or -bpthumb anywhere in their filename

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Thu Mar 22 02:16:04 UTC 2012

#4092: Buddypress will show wrong user avatars if they contain -bpfull or -bpthumb
anywhere in their filename
 Reporter:  defunctlife   |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Core          |     Version:  1.5.4
 Severity:  normal        |  Resolution:  invalid
 Keywords:  needs-patch   |
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


 Hm. I think that the old-style avatar naming that John is thinking of is
 `-avatar2`, `-groupavatar-full`, etc. See eg
 avatars.php#L125 I don't recall a time in BP history when the dimensions
 of the image were attached to the filename in this way.

 I'm guessing that the theme in question is using some of WP's media
 handling functions that automatically produce multiple versions of an
 uploaded file at different cropped sizes. Since BP's avatar handling
 functions don't do this, it must mean that the themeforest theme is doing
 its own avatar logic - but, strangely, it is putting those uploaded files
 into BP-specific avatar directories. I don't think it's appropriate for BP
 to be accounting for this sort of behavior by themes - if themes want to
 handle their own avatar uploads, they should either conform to BP's naming
 standards, or they should override BP's avatars altogether by filtering
 `bp_core_fetch_avatar` or removing our `get_avatar` filters.

 I'm going to close this ticket as invalid on this logic. defunctlife, if
 it turns out that I'm misunderstanding the situation, and this really is
 somehow BP's fault (or indicative of a larger issue than a single rogue
 theme), please reopen with more details. In the meantime, you can consider
 simply filtering `bp_core_fetch_avatar` and using `preg_replace()` to
 strip off any trailing dimensions from the filename.

Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4092#comment:4>
BuddyPress <http://buddypress.org/>

More information about the buddypress-trac mailing list