Opened 8 years ago
Closed 8 years ago
#39955 closed defect (bug) (fixed)
Media details: HTML character shown as code
Reported by: | Irian | Owned by: | kirasong |
---|---|---|---|
Milestone: | 4.8 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Media | Keywords: | good-first-bug has-patch |
Focuses: | ui, administration | Cc: |
Description
In the media details screen, the 'uploaden by' information shows html entities encoded (Hoover & Hitch is shown as Hoover & Hitch).
Attachments (5)
Change History (23)
#1
@
8 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to 4.8
- Version changed from 4.7.2 to 4.0
This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.
8 years ago
#4
@
8 years ago
@arshidkv12 Thanks for the patch. We should probably take a look at where the data is coming from here to make sure this doesn't introduce any concerns by not escaping in the template.
This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.
8 years ago
#9
@
8 years ago
- Keywords needs-patch added; has-patch removed
Let's not open the possibility to parse HTML there, instead we should make use of html_entity_decode()
. See [32822] for an example.
Looks like this needs to happen in wp_prepare_attachment_for_js()
.
This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.
8 years ago
#12
@
8 years ago
Not sure if it makes a difference, but I noticed that there's a slightly different behavior with attachments that have an author of ID 0
before and after the patch.
Before, the author shows as "false" (due to $author->display_name
returning false
).
After the patch is applied, the author shows as an empty string.
I noticed this due to test attachments being present on my install, something which I'm guessing is not very common in practice, but figured the behavior change was worth noting.
#13
@
8 years ago
In 39955.3.diff indicate if the author isn't found, rather than returning the converted string for the false
bool.
I used (no author)
for display to match the (no title)
used when there isn't a title.
I'm not sure if this is optimal, but either way would like to make sure we're specifying an output when there isn't an author found, rather than it happening incidentally.
#14
@
8 years ago
- Keywords needs-unit-tests added; needs-testing removed
Tested 39955.3.diff and this fixes the issue. I think the extra sanity check here makes sense and the string seems sensible. It would be nice to add a unit test here.
#15
@
8 years ago
- Owner changed from joemcgill to mikeschroder
- Status changed from accepted to assigned
Confirmed. Thanks for the report, @Irian.