Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#58387 closed defect (bug) (fixed)

Use esc_attr() in _navigation_markup()

Reported by: sabernhardt's profile sabernhardt Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.3 Priority: normal
Severity: normal Version:
Component: Themes Keywords: has-patch commit
Focuses: Cc:

Description

Follow-up to #47123 / [46236]

The esc_attr escaping function should be more appropriate for the aria-label attribute than esc_html.
source:/tags/6.2/src/wp-includes/link-template.php#L3024

Attachments (1)

58387.diff (610 bytes) - added by sabernhardt 17 months ago.

Download all attachments as: .zip

Change History (13)

@sabernhardt
17 months ago

#1 @sabernhardt
17 months ago

  • Keywords has-patch added

#2 @costdev
17 months ago

Makes sense and the patch looks straightforward.

@sabernhardt does the whole unit test suite still pass locally? Just in case this causes an unexpected failure somewhere along the line.

#3 @SergeyBiryukov
17 months ago

  • Keywords commit added

Good catch, thanks!

#4 @sabernhardt
17 months ago

I could make a PR to check the unit tests.

#6 @sabernhardt
17 months ago

The unit tests passed.

#7 @costdev
17 months ago

Nice, thanks for that @sabernhardt, seems like a clean and simple change!

@mukesh27 commented on PR #4493:


17 months ago
#8

@sabernhardt one question: $aria_label is use value of $screen_reader_text so do we need to update $screen_reader_text also?

@sabernhardt commented on PR #4493:


17 months ago
#9

The standard template uses the $screen_reader_text variable inside an h2 element.

(Without an $aria_label argument, the function would reuse $screen_reader_text for both the aria-label attribute and the heading. They still would have different escaping functions.)

@mukesh27 commented on PR #4493:


17 months ago
#10

Make sense, thanks @sabernhardt for clarification.

#11 @SergeyBiryukov
17 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 55863:

Themes: Use correct escaping function for aria-label in _navigation_markup().

Follow-up to [46236].

Props sabernhardt, costdev, mukesh27.
Fixes #58387.

@SergeyBiryukov commented on PR #4493:


17 months ago
#12

Thanks for the PR! Merged in r55863.

Note: See TracTickets for help on using tickets.