[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:32:13 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   |
--------------------------+----------------------

Comment (by boonebgorges):

 > others could do this down the road

 Right, but my point is (insofar as I have a point) that themes and plugins
 can do whatever the heck they want, and BP has to draw the line somewhere
 :) It's just not possible for us to account for every possible weird thing
 that a theme might do. IMO this straightforwardly a bug in the Salutation
 theme - obviously, the theme author intended for the avatars to be BP-
 compatible, but clearly he/she overlooked the fact that there may be
 naming conflicts in this way. So the real solution is to get it fixed in
 Salutation.

 One patch that I guess I would consider appropriate is to add a `break`
 when a match is found:

 {{{
 // Check for current avatar
 foreach( $avatar_files as $key => $value ) {
     if ( strpos ( $value, $avatar_size )!== false ) {
         $avatar_url = $avatar_folder_url . '/' . $avatar_files[$key];
         break;
     }
 }
 }}}

 Not because it would fix Salutation's bug (though it would, in this case,
 do so), but because there's no reason to continue to loop through the
 directory looking for other versions of the avatar once one is found -
 breaking out of the loop will save a few wasted CPU cycles. This would
 need testing before implementing, though.

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


More information about the buddypress-trac mailing list