Make WordPress Core

Opened 4 months ago

Closed 4 months ago

#64127 closed defect (bug) (fixed)

KSES: Add `name` attribute to the <details> element

Reported by: soean's profile Soean Owned by: westonruter's profile westonruter
Milestone: 6.9 Priority: normal
Severity: normal Version: 6.8
Component: General Keywords: has-patch
Focuses: Cc:

Description (last modified by westonruter)

We should add the name attribute to the details element in the global $allowedposttags array.

The details block supports the name attribute since WP 6.8, so it needs to be added. Otherwise, it will be stripped when saving.

Related to:

Change History (7)

This ticket was mentioned in PR #10382 on WordPress/wordpress-develop by @Soean.


4 months ago
#1

  • Keywords has-patch added

We should add the name attribute to the details element in the global $allowedposttags array.

The details block supports the name attribute since WP 6.8, so it needs to be added. Otherwise, it will be stripped when saving.

Trac ticket: https://core.trac.wordpress.org/ticket/64127

#2 @westonruter
4 months ago

  • Milestone changed from Awaiting Review to 6.9
  • Owner set to westonruter
  • Status changed from new to accepted

#3 @westonruter
4 months ago

  • Keywords good-first-bug added
  • Owner westonruter deleted
  • Status changed from accepted to assigned

This is a good ticket for a new contributor to write up a patch. I'm happy to help commit!

#4 @westonruter
4 months ago

  • Keywords good-first-bug removed
  • Owner set to westonruter
  • Status changed from assigned to reviewing

Oops. It has a patch 😊

#5 @westonruter
4 months ago

  • Description modified (diff)

#6 @westonruter
4 months ago

  • Version set to 6.8

This issue was introduced in 6.8 via [59775] and Gutenberg 20.2.

#7 @westonruter
4 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 61051:

Editor: Allow name attribute on the details element in KSES.

The details element supports the exclusive accordion behavior among multiple details elements by setting a common name attribute. The ability to set the name attribute in the Details block was added in of Gutenberg 20.2. However, when a user without unfiltered_html attempts to save the post, the name attribute gets erroneously stripped out. This prevents that.

See Details block: Exclusive accordions.

Follow-up to [14406], [59775].

Props soean.
See #12835, #62887.
Fixes #64127.

Note: See TracTickets for help on using tickets.