Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#56145 closed defect (bug) (fixed)

unescaped 'home_url()' in 'wp-admin/themes.php' file in 'line 269'

Reported by: obayedmamur Owned by: desrosj
Priority: normal Milestone: 6.1
Component: Themes Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: administration

Description

Hi there, ๐Ÿ™‚

It's my first ticket at WordPress core.

I've found that in 'wp-admin/themes.php' file, in line number 269 there's 'home_url()' used without escaping. I think it should be escaped.

Attachments (2)

56145.patch (771 bytes ) - added by hurayraiit 4 years ago.
Good finding! This should do the trick. :-)
56145_1.patch (1.2 KB ) - added by hurayraiit 4 years ago.

Download all attachments as: .zip

Change History (17)

#1 @hztyfoon
4 years ago

Hey @obayedmamur, thanks for your contribution to WordPress. Hope you'll continue your contribution.

@hurayraiit
4 years ago

Good finding! This should do the trick. :-)

#2 @hztyfoon
4 years ago

  • Keywords has-patch added

#3 @costdev
4 years ago

  • Keywords commit added
  • Milestone Awaiting Review โ†’ 6.1
  • Version trunk

Hi @obayedmamur, welcome to Trac and thanks for the patch @hurayraiit!

The patch looks good to me. ๐Ÿ‘

Last edited 4 years ago by costdev (previous) (diff)

#4 @hurayraiit
4 years ago

Hi @costdev,
Thank you so much for the commit.

Version 0, edited 4 years ago by hurayraiit (next)

#5 follow-up: @desrosj
4 years ago

  • Keywords changes-requested added; commit removed

@hurayraiit It looks like there is a second instance of home_url() not being wrapped with esc_url() that 56145.patchโ€‹ fixes, but the one mentioned in the original ticket title is not corrected.

Could you change both at the same time in one patch?

#6 @desrosj
4 years ago

  • Component Administration โ†’ Themes
  • Focuses coding-standards removed

#7 in reply to: ↑ 5 @hurayraiit
4 years ago

Replying to desrosj:

@hurayraiit It looks like there is a second instance of home_url() not being wrapped with esc_url() that 56145.patchโ€‹ fixes, but the one mentioned in the original ticket title is not corrected.

Could you change both at the same time in one patch?

Yeah, absolutely. Let me check please.

@hurayraiit
4 years ago

#8 @hurayraiit
4 years ago

Hi @desrosj
Thanks for the comment. I have attached the patch for line 273 also in the second attachment(56145_1.patch). Please let me know if there's anything else I can do.

#9 @costdev
4 years ago

Related ticket: #56146

#10 @obayedmamur
4 years ago

Thanks to everyone for your quick response! Loved it! ๐Ÿ’–

#11 @hztyfoon
4 years ago

Related ticket: #56132, #56133, #56146

#12 @hztyfoon
4 years ago

Both patches looks good to me. Good Work. Thanks @hurayraiit for your contribution.

#13 @desrosj
4 years ago

#56146 was marked as a duplicate.

#14 @desrosj
4 years ago

  • Keywords commit added; changes-requested removed

#15 @desrosj
4 years ago

  • Owner set to desrosj
  • Resolution โ†’ fixed
  • Status new โ†’ closed

In 53677:

Themes: Properly escape home_url() when changing and updating themes.

Props obayedmamur, hurayraiit, costdev, shraboni, msnewas.
Fixes #56145.

Note: See TracTickets for help on using tickets.