#2735 closed defect (bug) (fixed)
GBP symbol (£) not removed from permalinks
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.0.6 |
| Component: | General | Version: | 2.0.2 |
| Severity: | minor | Keywords: | has-patch |
| Cc: |
Description
If a post title contains the symbol for the British pound sterling, £, it is not removed from the permalink URL as would be the case with most other punctuation. For example, if a post is published with the title "WordPress costs £0", the post title in the generated permalink would be "wordpress-costs-%c2%a30" instead of the expected "wordpress-costs-0".
Attachments (1)
Change History (15)
comment:2
NekoFever
— 7 years ago
It's a valid URL and works but it doesn't exactly look nice. Surely it's a bug when other symbols (including $ and €) get filtered but that doesn't?
comment:3
markjaquith
— 7 years ago
Cannot duplicate. Comes out as wordpress-costs-%c2%a30
How is your £ getting past this?
$title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
Are you sure you're not using a plugin that does its own title filtering?
comment:4
skeltoac
— 7 years ago
Mark: That's exactly the result that he's getting. You DID duplicate it. :-) The point of the bug report was to have the GBP sign stripped just as we strip dollars and yen.
Neko: Okay, I agree with you. Let's strip it before url encoding. Can you patch it?
comment:5
markjaquith
— 7 years ago
Me no read good.
ketsugi
— 7 years ago
This should strip the pound symbol. I couldn't figure out where the $ symbol was being stripped so I put it in with the remove_accents() function.
comment:6
ketsugi
— 7 years ago
I'm stupid and I need to brush up on my regular expressions. In any case because the pound symbol is a double-byte unicode char, I guess it's best placed in there with remove_accents().
comment:9
markjaquith
— 7 years ago
The Euro symbol is converted to "E"
Should the GBP symbold be converted to an "L" ?
I think it looks like an "L," but I'm American, so I'd like an opinion from someone who actually uses the currency.
comment:10
markjaquith
— 7 years ago
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
Westi says "no" to converting to L, so I'm putting it in as it stands.
comment:11
markjaquith
— 7 years ago
- Resolution set to fixed
- Status changed from assigned to closed
comment:12
markjaquith
— 7 years ago
comment:14
Denis-de-Bernardy
— 4 years ago
- Milestone changed from Unassigned to 2.0.6
So what's the problem? Isn't that a valid URL? This looks like an expectation bug to me, but I've been known to err.