Skip to:
Content

BuddyPress.org

Opened 7 months ago

Closed 7 months ago

Last modified 5 months ago

#8063 closed defect (bug) (fixed)

Multi-Line Text Area loses existing formatting on re-edit

Reported by: neilgee Owned by: boonebgorges
Milestone: 5.0.0 Priority: normal
Severity: normal Version: 2.1
Component: Extended Profile Keywords:
Cc:

Description

The profile field Multi-Line Text Area gives the user a rich text editor when editing a profile field defined as this type.

However, if the profile field has bulleted lists or text alignment formats used it saves correctly but when re-edited the formats are lost.

https://buddypress.org/support/topic/multi-line-text-area-loses-formatting/

Change History (5)

#1 @boonebgorges
7 months ago

  • Component changed from Core to Extended Profile
  • Milestone changed from Awaiting Review to 5.0.0
  • Version changed from 4.1.0 to 2.1

Hi @neilgee - Thanks very much for the report.

I've confirmed the issue. It's due to some inconsistent HTML filtering. At the time of profile save, rich text field values are sanitized using an expanded set of allowed HTML tags. At the time of profile display, the sanitization is too broad - because of the way the legacy logic worked, the expanded set of HTML tags is ignored in this case. See #5742, #5625.

I'll put a fix in place.

#2 @boonebgorges
7 months ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 12361:

XProfile: When displaying field data, sanitize HTML properly for richtext.

Previously, kses display filters were not always provided with enough
information to determine whether the current field supports rich text,
and thus ought to be filtered against an extended HTML tag whitelist.

Fixes #8063.

#3 @neilgee
5 months ago

@boonebgorges I tested with the new changes

bp-xprofile-filters.php

But still loses list formatting on save.

#4 @boonebgorges
5 months ago

In 12396:

Ensure that xprofile field value HTML whitelist is applied during profile edit.

See #8063, #8094.

#5 @boonebgorges
5 months ago

Hi @neilgee - When reporting issues, please provide as much detail as possible about exactly what you see and what you expect to see - your comment doesn't give enough context for me to be sure which bit of content you're talking about.

In conjunction with #8094, I noticed that the fix in [12361] doesn't account for *edit* mode (perhaps this is what you're seeing @neilgee ?). [12396] should fix this.

Note: See TracTickets for help on using tickets.