[wp-trac] Re: [WordPress Trac] #3843: Smart quote apostrophe ’ results in a permalink URL with %e2%80%99

WordPress Trac wp-trac at lists.automattic.com
Mon Feb 26 02:58:13 GMT 2007


#3843: Smart quote apostrophe ’ results in a permalink URL with %e2%80%99
----------------------------+-----------------------------------------------
 Reporter:  foolswisdom     |        Owner:  anonymous
     Type:  defect          |       Status:  new      
 Priority:  low             |    Milestone:  2.2      
Component:  Administration  |      Version:  2.2      
 Severity:  minor           |   Resolution:           
 Keywords:  slug permalink  |  
----------------------------+-----------------------------------------------
Comment (by jhodgdon):

 Just a little clarification. The function being used to create the slug is
 sanitize_title_with_dashes in wp-includes/formatting.php

 The sequence of events is currently:

 1) Post title becomes the slug candidate

 2) Accents are removed (replaced by un-accented letters)

 3) Characters that still look like they are UTF-8 are encoded with
 utf8_uri_encode into octets (%e2, etc.) (this is what is creating the
 reported behavior)

 4) HTML entities and any character except letters, numbers, underscores,
 spaces, octets, and hyphens are removed (this is where other punctuation
 is removed)

 5) Spaces are turned into hyphens, and whole thing is lower-cased

 So... to fix this, would have to add step 2.5:

 2.5: Translate into hyphens, or remove (more consistent with what happens
 to other punctuation), a specific list of special (but common) punctuation
 characters.

 Questions:

 a) Is this worth doing, considering that the current behavior makes a
 usable slug, and that you can always edit your slug by hand if you want
 to?

 b) If it is worth doing, what should the list of special punctuation
 characters be, and should they be removed or translated into hyphens?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/3843#comment:3>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list