Opened 9 months ago
Closed 7 months ago
#53138 closed defect (bug) (duplicate)
Convert special HTML entities in characters in widgets descriptions
Reported by: | justinahinon | Owned by: | audrasjb |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 5.8 |
Component: | Widgets | Keywords: | |
Focuses: | Cc: |
Description
Follow up of this issue https://github.com/WordPress/gutenberg/issues/31023 on Gutenberg.
WordPress doesn't decode the HTML entities in widgets descriptions, so these one show as that in Gutenberg widget screen.
This appears in Archives, Recent posts, Meta, Recent comments widgets.
Change History (16)
This ticket was mentioned in PR #1220 on WordPress/wordpress-develop by JustinyAhin.
9 months ago
- Keywords has-patch added
#2
@
9 months ago
JustinyAhin commented on PR #1220:
Looks like there are some PHPCS issues
#3
@
9 months ago
- Milestone changed from Awaiting Review to 5.8
Yes @justinahinon, you can't use a PHP function inside a gettext function.
__( html_entity_decode( 'Your site’s most recent Posts.' ) )
Should be replaced with something like:
html_entity_decode( __( 'Your site’s most recent Posts.' ) )
Moving for 5.8 consideration since it's related to trunk.
This ticket was mentioned in Slack in #core by hellofromtonya. View the logs.
8 months ago
#11
@
8 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
Thanks for the patch! However, I don't think [51114] is the correct approach here:
- It does not account for translations. These four widgets are just the ones that have entities in their English description, translations may add or remove entities, so decoding them only for some of the widgets is not a consistent solution.
- It does not account for custom widgets. Any custom widgets that have entities in their description would still run into the same issue.
If the block editor displays these descriptions somewhere without decoding entities first, it should be fixed there, on display, consistently for all widgets, and not in the individual widgets' constructors. So I would recommend reverting [51114] for now.
This ticket was mentioned in Slack in #core by whyisjake. View the logs.
8 months ago
#13
@
8 months ago
- Keywords needs-patch needs-testing needs-unit-tests added; has-patch commit removed
- Milestone changed from 5.8 to 5.9
As @SergeyBiryukov notes, the patch needs more work. Also could use automated tests and testing.
As today is 5.8 Beta 1, punting to 5.9 to continue work towards resolution.
Fixes Trac ticket https://core.trac.wordpress.org/ticket/53138