Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#6069 closed defect (bug) (fixed)

bp_core_fetch_avatar() no longer allows multiple classes to be passed to it

Reported by: needle Owned by: imath
Priority: normal Milestone: 2.2
Component: Media Version:
Severity: normal Keywords: has-patch commit
Cc:

Description

Because BP trunk uses sanitize_html_class( $params['class'] ), avatars can no longer be created with multiple classes. It used to be the case that one could define $avatar_options = array ( 'class' => 'first_class second_class' ), but sanitize_html_class() concatenates these into a single string, i.e. 'first_classsecond_class'. There's no workaround of passing an array.

Not sure if this is a bug or by design, so leaving Type = bug.

Attachments (2)

6069.patch (1.3 KB ) - added by imath 12 years ago.
6069.unittests.patch (1.9 KB ) - added by imath 12 years ago.

Download all attachments as: .zip

Change History (9)

#1 @DJPaul
12 years ago

  • Milestone Awaiting Review2.2

The relevant change was r9125 and this appears to be a consequence of some added sanitisation. If you were using it as an array, there must be other people who were, so I'm suggesting we need to fix this for 2.2.

#2 @imath
12 years ago

  • Keywords has-patch added

I suggest 6069.patch

@imath
12 years ago

#3 @boonebgorges
12 years ago

  • Keywords needs-unit-tests added

6069.patch looks good. Would be nice to see a unit test or two, at least for the array regression.

#4 @imath
12 years ago

  • Keywords needs-unit-tests removed

Thanks for your feedback boonebgorges 6069.unittests.patch checks no value, "space separated" value and an array of classes.

#5 @boonebgorges
12 years ago

  • Keywords commit added

Looks great. Thanks imath.

#6 @imath
12 years ago

  • Owner set to imath
  • Resolutionfixed
  • Status newclosed

In 9381:

Allow multiple classes to be passed to the class argument of bp_core_fetch_avatar()

Using an array of classes or a list of classes separated by a space for the class argument of bp_core_fetch_avatar() will output each one of them into the class attribute of the image tag.

Fixes #6069

#7 @DJPaul
10 years ago

  • Component API - AvatarsMedia
Note: See TracTickets for help on using tickets.