Make WordPress Core

Opened 17 months ago

Last modified 17 months ago

#50692 new defect (bug)

WordPress v5.4.2 Escaping Problem in the Edit Media Screen

Reported by: rafaelcardero Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 5.4.2
Component: Media Keywords: needs-patch
Focuses: administration Cc:


WordPress v5.4.2 escapes the content of the Description field in the Edit Media screen if the filter 'user_can_richedit' returns false.

How to Replicate
1) Upload an attachment and open the Edit Media screen
2) Add a simple HTML markup to the Description field. Example: <p>Hello World!</p>
3) Save changes and check that the content of the field is not HTML escaped
4) Add the following line to the current theme

add_filter('user_can_richedit', '__return_false', 999, 0);

5) Go back to the Edit Media screen and save changes again
6) Problem: The content of the field Description is HTML escaped

I administer a WordPress website since many years ago and I disabled the WYSIWIG editor setting the value of the filter 'user_can_richedit' to false. I like to enter HTML code directly. Now I am unable to use HTML code in the Description field as I did previously.

Probably other users are also facing this problem.

Change History (2)

#1 @johnbillion
17 months ago

  • Component changed from Editor to Media
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Thanks for the report @rafaelcardero. I've confirmed this is an issue.

Introduced in [47948] for 5.4.2.

#2 @rafaelcardero
17 months ago

Glad to help @johnbillion.

Note: See TracTickets for help on using tickets.