Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#43401 closed enhancement (fixed)

Support urldecoded URLs in current menu item detection logic

Reported by: soulseekah's profile soulseekah Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

When adding a urldecoded custom link to a menu it is not being detected as the current one when visiting it.

This doesn't work:

http://example.org/привет/
/привет/

This works:

http://example.org/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/
/%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82/

Attachments (2)

43401.tests.patch (1.5 KB) - added by soulseekah 7 years ago.
Initial tests
43401.1.patch (1.2 KB) - added by soulseekah 7 years ago.
Initial patch

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
7 years ago

  • Keywords needs-patch needs-unit-tests added

@soulseekah
7 years ago

Initial tests

@soulseekah
7 years ago

Initial patch

#2 @soulseekah
7 years ago

  • Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed

#3 @soulseekah
7 years ago

Props to @campusboy1987 for discovering and describing the issue.

#4 @campusboy1987
7 years ago

I checked the edits of @soulseekah on a couple of sites where such a problem arose. Now everything works fine! I'm looking forward to the resilience. Gennady (@soulseekah), thanks for the quick response and solution.

#5 @SergeyBiryukov
7 years ago

  • Milestone changed from Awaiting Review to 5.0

#6 @SergeyBiryukov
7 years ago

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

In 42732:

Menus: When checking if a Custom Link matches the current URL to add the current-menu-item class, check for decoded URL as well.

Props soulseekah, campusboy1987.
Fixes #43401.

#7 @johnbillion
6 years ago

  • Milestone changed from 5.0 to 5.1
Note: See TracTickets for help on using tickets.