[wp-trac] [WordPress Trac] #2877: A Slash too much @ get_pagenum_link()

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 29 17:47:31 GMT 2006


#2877: A Slash too much @ get_pagenum_link()
-------------------------------+--------------------------------------------
 Reporter:  dave at mad-dave.net  |       Owner:  anonymous
     Type:  defect             |      Status:  new      
 Priority:  normal             |   Milestone:           
Component:  General            |     Version:  2.0.3    
 Severity:  normal             |    Keywords:           
-------------------------------+--------------------------------------------
 * File: template-functions-links.php
  * Function: get_pagenum_link()

 The following code is at the end of the function:

 {{{
         // showing /page/1/ or ?paged=1 is redundant
         if ( 1 === $pagenum ) {
                 $qstr = str_replace('page/1/', '', $qstr); // for
 mod_rewrite style
                 $qstr = remove_query_arg('paged', $qstr); // for query
 style
         }
 }}}

 If you work with the mod_rewrite style, you will get this URL for the
 first page:

 http://www.example.com/wordpress/index.php/
 This wont work (/ at the end).

 Correx:
 {{{
         // showing /page/1/ or ?paged=1 is redundant
         if ( 1 === $pagenum ) {
                 $qstr = str_replace('/page/1/', '', $qstr); // for
 mod_rewrite style
                 $qstr = remove_query_arg('paged', $qstr); // for query
 style
         }
 }}}

 Notes:

  * sry for my bad english...
  * i've downloaded a german translation of wordpress 2.0.3, so maybe its
 just in this version... ?!

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


More information about the wp-trac mailing list