WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#2735 closed defect (bug) (fixed)

GBP symbol (£) not removed from permalinks

Reported by: NekoFever Owned by: markjaquith
Milestone: 2.0.6 Priority: normal
Severity: minor Version: 2.0.2
Component: General Keywords: has-patch
Focuses: 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)

formatting.php.diff (478 bytes) - added by ketsugi 8 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.

Download all attachments as: .zip

Change History (15)

comment:1 skeltoac8 years ago

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.

comment:2 NekoFever8 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 markjaquith8 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 skeltoac8 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 markjaquith8 years ago

Me no read good.

ketsugi8 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 ketsugi8 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:7 Nazgul8 years ago

  • Keywords has-patch added
  • Milestone set to 2.1

comment:8 Nazgul8 years ago

  • Milestone changed from 2.1 to 2.0.5

2.0.5 Candidate

comment:9 markjaquith8 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 markjaquith8 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 markjaquith8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [4319]) Strip out British pound sterling (pound) symbol from post slug. fixes #2735

comment:12 markjaquith8 years ago

(In [4320]) Strip out British pound sterling (pound) symbol from post slug. fixes #2735

comment:13 anonymous7 years ago

  • Milestone 2.0.5 deleted

Milestone 2.0.5 deleted

comment:14 Denis-de-Bernardy4 years ago

  • Milestone changed from Unassigned to 2.0.6
Note: See TracTickets for help on using tickets.