WordPress.org

Make WordPress Core

Opened 21 months ago

Closed 21 months ago

Last modified 13 months ago

#43401 closed enhancement (fixed)

Support urldecoded URLs in current menu item detection logic

Reported by: soulseekah Owned by: SergeyBiryukov
Milestone: 5.1 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch has-unit-tests
Focuses: Cc:
PR Number:

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 21 months ago.
Initial tests
43401.1.patch (1.2 KB) - added by soulseekah 21 months ago.
Initial patch

Download all attachments as: .zip

Change History (9)

#1 @SergeyBiryukov
21 months ago

  • Keywords needs-patch needs-unit-tests added

@soulseekah
21 months ago

Initial tests

@soulseekah
21 months ago

Initial patch

#2 @soulseekah
21 months ago

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

#3 @soulseekah
21 months ago

Props to @campusboy1987 for discovering and describing the issue.

#4 @campusboy1987
21 months 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
21 months ago

  • Milestone changed from Awaiting Review to 5.0

#6 @SergeyBiryukov
21 months 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
13 months ago

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