Opened 5 years ago
Closed 5 years ago
#54255 closed defect (bug) (wontfix)
Use esc_html() to escaping variable in about page
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Help/About | Keywords: | has-patch |
| Focuses: | coding-standards | Cc: |
Description
On about.php there is a variable echo without escaping. like
<?php echo $display_version; ?>
to print the WordPress version. On others file, this kind of print use esc_html() escaping.
It should have to use there also.
Attachments (3)
Change History (12)
#2
@
5 years ago
- Keywords commit added
- Milestone changed from Awaiting Review to 5.9
- Version trunk deleted
Yes, it doesn't hurt. Patch looks good to me.
Removing trunk version as it wasn't really introduced in WP 5.8 :)
#3
@
5 years ago
- Component changed from Formatting to Help/About
- Focuses coding-standards added; ui removed
#4
@
5 years ago
@rehanali thanks, but it is not necessary to create a new patch with the same exact content than the previous one :)
#5
@
5 years ago
also @rehanali you have to create your diff file against the wordpress-develop folder location ;)
#6
follow-up:
↓ 7
@
5 years ago
- Keywords needs-refresh added; commit removed
Hi there, Thanks for the ticket and patch!
Please add brackets before and after $display_version?
<?php echo esc_html( $display_version ); ?>
Remove commit for now.
#7
in reply to:
↑ 6
@
5 years ago
- Keywords needs-refresh removed
Thank you for pointing out this title mistake. I added another patch with the mentioned change.
Replying to mukesh27:
Hi there, Thanks for the ticket and patch!
Please add brackets before and after
$display_version?
<?php echo esc_html( $display_version ); ?>Remove
commitfor now.
#9
@
5 years ago
- Keywords commit removed
- Milestone 5.9 deleted
- Resolution set to wontfix
- Status changed from new to closed
Thanks everyone for taking a look at this!
I've done some looking back at past versions to see if $display_version has been escaped in the past, and it looks like it never was.
Looking into why, my assumption is most likely that $wp_version can generally be considered trusted. get_bloginfo( 'version' ) returns the value stored in the $wp_version global variable. Though there are filters in get_bloginfo(), the value is not passed through either of them because the default context is raw, not display.
I'm going to close this out as wontfix following precedent.
Created patch.