Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#49833 closed enhancement (fixed)

Twenty Twenty: HTML in featured image caption is being escaped

Reported by: pierlo's profile pierlo Owned by: ianbelanger's profile ianbelanger
Milestone: 5.5 Priority: normal
Severity: normal Version: 5.3
Component: Bundled Theme Keywords: has-patch good-first-bug has-screenshots
Focuses: Cc:

Description

Featured images that contain HTML in their captions are being escaped in Twenty Twenty. A valid case for having HTML here would be to link to the original source the image was taken, or even a way to credit the author of the image.

Attachments (2)

49833.diff (652 bytes) - added by pierlo 5 years ago.
Capture d’écran 2020-05-23 à 11.07.14.png (207.9 KB) - added by audrasjb 5 years ago.
Testing the patch with various HTML elements

Download all attachments as: .zip

Change History (12)

@pierlo
5 years ago

#1 @pierlo
5 years ago

  • Keywords has-patch added

#2 @spacedmonkey
5 years ago

  • Version set to 5.3

#3 @spacedmonkey
5 years ago

  • Keywords good-first-bug 2nd-opinion added

#4 @JavierCasares
5 years ago

  • Keywords has-screenshots added

Works for me.

https://i.ibb.co/vYQNrYZ/Screenshot-241.png

vs

https://i.ibb.co/2jf30Nt/Screenshot-242.png

#5 @spacedmonkey
5 years ago

  • Milestone changed from Awaiting Review to 5.5

@audrasjb
5 years ago

Testing the patch with various HTML elements

#6 @audrasjb
5 years ago

  • Keywords commit added; 2nd-opinion removed
  • Owner set to audrasjb
  • Status changed from new to accepted

I tested 49833.diff with various HTML elements and it looks good to me.

Removing 2nd-opinion and marking this ticket for commit.

#7 @ianbelanger
4 years ago

  • Owner changed from audrasjb to ianbelanger
  • Status changed from accepted to assigned

Reviewing for commit.

#8 @ianbelanger
4 years ago

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

In 47940:

Bundled Themes: Twenty Twenty HTML in featured image caption is being escaped.

Fixes the issue by replacing esc_html with wp_kses_post in the caption in featured images.

Props pierlo, JavierCasares, audrasjb.
Fixes #49833.

#9 @ianbelanger
4 years ago

  • Keywords fixed-major added; commit removed
  • Milestone changed from 5.5 to 5.4.3
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport.

#10 @desrosj
4 years ago

  • Keywords fixed-major removed
  • Milestone changed from 5.4.3 to 5.5
  • Resolution set to fixed
  • Status changed from reopened to closed

With 5.5 just under 5 weeks away, there is no 5.4.3 planned. Moving back to the 5.5 milestone.

Note: See TracTickets for help on using tickets.