#47723 closed defect (bug) (fixed)
Adding a custom link in nav-menus.php doesn't trim whitespace
Reported by: | majemedia | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 5.2.3 | Priority: | normal |
Severity: | minor | Version: | |
Component: | Menus | Keywords: | good-first-bug fixed-major |
Focuses: | ui | Cc: |
Description
When building a nav-menu and utilizing custom links the entered value isn't trimmed.
Once you click 'Add to Menu':
- If you have whitespace at the start: no url added to the custom link in the menu item
- If you have whitespace at the end: %20 is added to the custom link
Attachments (1)
Change History (16)
#1
@
5 years ago
- Focuses administration removed
- Keywords needs-patch good-first-bug added; dev-feedback removed
- Owner set to audrasjb
- Status changed from new to accepted
- Version 5.2.2 deleted
This ticket was mentioned in Slack in #core by majemedia. View the logs.
5 years ago
#7
@
5 years ago
- Keywords needs-testing fixed-major added
- Milestone changed from 5.3 to 5.2.3
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening this so it can be back-ported to the 5.2 branch.
Also adding needs-testing
keyword to validate if this ticket is good to land in 5.2.3 (should be ok though).
#8
@
5 years ago
I've tested the fix against a 5.2 branch checkout and its working as expected to me with no regressions.
Tested:
- Leading space
- Ending space
- Leading and ending space
- No leading/ending space
Note that I did not apply the test file generated by the original trunk commit.
#10
@
5 years ago
+1 Patch applies cleanly and problem resolves. However it's good to point out that the issue with ending whitespace still happens when you add the custom link via Customizer. But I think that can be another ticket.
Hi and thanks for your report.
Milestoning this one to next major.