Make WordPress Core

Ticket #1357: template-functions-links.16.php.diff

File template-functions-links.16.php.diff, 842 bytes (added by markjaquith, 20 years ago)

Patch against 1.6 SVN

  • template-functions-links.php

     
    409409
    410410        $qstr = preg_replace('|^/+|', '', $qstr);
    411411        if ($permalink) $qstr = trailingslashit($qstr);
    412         return preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr );
     412        $qstr = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', trailingslashit( get_settings('home') ) . $qstr );
     413       
     414        // showing /page/1/ or ?paged=1 is redundant
     415        if ($pagenum === 1) {
     416        $qstr = str_replace('page/1/', '', $qstr); // for mod_rewrite style
     417        $qstr = remove_query_arg('paged', $qstr); // for query style
     418        }
    413419}
    414420
    415421function next_posts($max_page = 0) { // original by cfactor at cooltux.org