Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54255 closed defect (bug) (wontfix)

Use esc_html() to escaping variable in about page

Reported by: sayedulsayem's profile sayedulsayem 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)

54255.diff (417 bytes) - added by sayedulsayem 3 years ago.
Created patch.
#54255.patch (360 bytes) - added by rehanali 3 years ago.
Created patch
54255.2.diff (419 bytes) - added by sayedulsayem 3 years ago.
Added space before and after in function params

Download all attachments as: .zip

Change History (12)

@sayedulsayem
3 years ago

Created patch.

#1 @sayedulsayem
3 years ago

  • Keywords has-patch added

#2 @audrasjb
3 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 :)

@rehanali
3 years ago

Created patch

#3 @audrasjb
3 years ago

  • Component changed from Formatting to Help/About
  • Focuses coding-standards added; ui removed

#4 @audrasjb
3 years ago

@rehanali thanks, but it is not necessary to create a new patch with the same exact content than the previous one :)

#5 @audrasjb
3 years ago

also @rehanali you have to create your diff file against the wordpress-develop folder location ;)

#6 follow-up: @mukesh27
3 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.

@sayedulsayem
3 years ago

Added space before and after in function params

#7 in reply to: ↑ 6 @sayedulsayem
3 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 commit for now.

#8 @mukesh27
3 years ago

  • Keywords commit added

Thanks for the quick patch.

Ready to marge. Mark as commit

#9 @desrosj
3 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.

Note: See TracTickets for help on using tickets.