Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#40216 closed defect (bug) (fixed)

Twenty Seventeen: Some parts do not escape html attributes

Reported by: bor0 Owned by: SergeyBiryukov
Priority: normal Milestone: 4.7.4
Component: Bundled Theme Version: 4.7
Severity: normal Keywords: has-patch fixed-major
Cc: Focuses:

Description

There are appearances like:
https://core.trac.wordpress.org/browser/trunk/src/wp-content/themes/twentyseventeen/footer.php#L25
https://core.trac.wordpress.org/browser/trunk/src/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php#L12

_e() in these cases should actually be esc_attr_e() to ensure the translated string gets escaped for an HTML attribute context, because the translated string from another language could potentially have a character that would need to be escaped.

Attachments (1)

40216.diff (1.5 KB ) - added by bor0 9 years ago.

Download all attachments as: .zip

Change History (7)

@bor0
9 years ago

#1 @bor0
9 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
9 years ago

  • Component SecurityBundled Theme
  • Milestone Awaiting Review4.8
  • Summary Some parts of Twentyseventeen do not esc html attrTwenty Seventeen: Some parts do not escape html attributes

#3 @iandunn
9 years ago

Here are future-proof links to the lines in question:

( linking to trunk is problematic, because those line numbers will invariably change in the future, and anyone who wants to look at the links will have to spend extra time to find the original ones )

#4 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 40311:

Twenty Seventeen: Use esc_attr_e() for translatable strings in HTML attributes.

Props bor0.
Fixes #40216.

#5 @SergeyBiryukov
9 years ago

  • Keywords fixed-major added
  • Milestone 4.84.7.4
  • Resolution fixed
  • Status closedreopened

Reopening for 4.7.4 consideration.

#6 @swissspidy
9 years ago

  • Resolutionfixed
  • Status reopenedclosed

In 40374:

Twenty Seventeen: Use esc_attr_e() for translatable strings in HTML attributes.

Props bor0.
Fixes #40216.

Merges [40311] to the 4.7 branch.

Note: See TracTickets for help on using tickets.