Opened 10 years ago
Closed 10 years ago
#31499 closed defect (bug) (fixed)
Trim non-breaking spaces from URLs
Reported by: | pento | Owned by: | pento |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | Canonical | Keywords: | has-patch |
Focuses: | Cc: |
Description
If a link to a WordPress site has a non-breaking space on the end of it, WordPress will give a 404, instead of showing the page. Refreshing the page (allowing the browser to trim the space) causes the page to load correctly.
Attachments (2)
Change History (7)
#1
@
10 years ago
- Component changed from General to Canonical
- Keywords has-patch added
- Milestone changed from Awaiting Review to 4.2
- Version set to 2.3
#2
follow-up:
↓ 3
@
10 years ago
Wouldn't preg_replace
do a search and replace for all non-breaking spaces, not just trim the last one?
#3
in reply to:
↑ 2
@
10 years ago
Replying to valendesigns:
Wouldn't
preg_replace
do a search and replace for all non-breaking spaces, not just trim the last one?
The $
at the end of the regex means it'll only match non-breaking spaces at the end of the string.
Note: See
TracTickets for help on using
tickets.
nbsp.html is a sample test case.
31499.diff trims any non-breaking spaces from the end of the URL, it doesn't trim them if there's a trailing
/
- the assumption is that they were incorrectly included in a copy/paste, for example, if they're at the very end of the URL. If there's a trailing/
, we assume it's intentional.