Opened 12 years ago
Closed 11 years ago
#31499 closed defect (bug) (fixed)
Trim non-breaking spaces from URLs
| Reported by: | pento | Owned by: | pento |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Canonical | Version: | 2.3 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
12 years ago
- Component General → Canonical
- Keywords has-patch added
- Milestone Awaiting Review → 4.2
- Version → 2.3
#2
follow-up:
↓ 3
@
11 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
@
11 years ago
Replying to valendesigns:
Wouldn't
preg_replacedo 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.