[wp-trac] [WordPress Trac] #8752: get_permalink() bug

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 29 22:38:41 GMT 2008

#8752: get_permalink() bug
 Reporter:  Denis-de-Bernardy  |       Owner:  anonymous
     Type:  defect (bug)       |      Status:  new      
 Priority:  normal             |   Milestone:  2.7.1    
Component:  General            |     Version:  2.7      
 Severity:  major              |    Keywords:           
 I presume this bug has been around for quite a while...

 If you define WP_HOME in the wp-config file to, say,

 then permalinks end up like:


 The issue is the way they're defined in the get_permalink() function:

 $permalink = get_option('home') . str_replace($rewritecode,
 $rewritereplace, $permalink);

 this should be:

 $permalink = rtrim(get_option('home'), '/') . '/',
 ltrim(str_replace($rewritecode, $rewritereplace, $permalink), '/');


Ticket URL: <http://trac.wordpress.org/ticket/8752>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list