[wp-trac] Re: [WordPress Trac] #3899: Function user_trailingslashit breaks .html permalinks

WordPress Trac wp-trac at lists.automattic.com
Sat Mar 10 08:37:29 GMT 2007


#3899: Function user_trailingslashit breaks .html permalinks
--------------------------------------+-------------------------------------
 Reporter:  lunabyte                  |        Owner:  anonymous
     Type:  defect                    |       Status:  closed   
 Priority:  normal                    |    Milestone:  2.2      
Component:  Administration            |      Version:  2.2      
 Severity:  major                     |   Resolution:  fixed    
 Keywords:  permalink html canonical  |  
--------------------------------------+-------------------------------------
Comment (by markjaquith):

 {{{untrailingslashit()}}} now uses {{{rtrim()}}} instead of regex (thanks
 Jamie!).  And now {{{trailingslashit()}}} calls {{{untrailingslashit()}}}
 then adds a slash, instead of checking for the existence of a trailing
 slash and conditionally adding one.  Benefit:

 {{{$foo = trailingslashit('http://wordpress.org//');}}}

 Old result: {{{http://wordpress.org//}}}

 New result: {{{http://wordpress.org/}}}

 So use {{{trailingslashit()}}} when you want the string to have one (and
 only one) trailing slash, and use {{{untrailingslashit()}}} when you want
 the string to have no trailing slashes.

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


More information about the wp-trac mailing list