Ticket #1762: 1762.diff

File 1762.diff, 2.5 KB (added by mdawaffe, 6 years ago)

reapply ryan's patch to current code. page_number_base (update: fix typo)

  • wp-includes/link-template.php

     
    357357 
    358358        $qstr = wp_specialchars($_SERVER['REQUEST_URI']); 
    359359 
    360         $page_querystring = "paged";  
    361         $page_modstring = "page/"; 
    362         $page_modregex = "page/?"; 
     360        $page_querystring = 'paged';  
     361        $page_modstring = $wp_rewrite->page_number_base . '/'; 
     362        $page_modregex = $wp_rewrite->pace_number_base . '/?'; 
    363363        $permalink = 0; 
    364364 
    365365        $home_root = parse_url(get_option('home')); 
  • wp-includes/rewrite.php

     
    150150        var $permalink_structure; 
    151151        var $category_base; 
    152152        var $category_structure; 
    153         var $author_base = 'author'; 
     153        var $author_base; 
    154154        var $author_structure; 
    155155        var $date_structure; 
    156156        var $page_structure; 
    157         var $search_base = 'search'; 
     157        var $search_base; 
    158158        var $search_structure; 
    159         var $comments_base = 'comments'; 
    160         var $feed_base = 'feed'; 
     159        var $comments_base; 
     160        var $feed_base; 
    161161        var $comments_feed_structure; 
    162162        var $feed_structure; 
    163163        var $front; 
     
    218218                                        ); 
    219219 
    220220        var $feeds = array ( 'feed', 'rdf', 'rss', 'rss2', 'atom' ); 
     221        var $page_number_base; 
    221222         
    222223        function using_permalinks() { 
    223224                if (empty($this->permalink_structure)) 
     
    232233                } 
    233234 
    234235                // If the index is not in the permalink, we're using mod_rewrite. 
    235                 if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) { 
     236                if (preg_match('#^/*' . $this->index . '#', $this->permalink_structure)) { /* */ 
    236237                        return true; 
    237238                } 
    238239     
     
    480481 
    481482                //build a regex to match the trackback and page/xx parts of URLs 
    482483                $trackbackregex = 'trackback/?$'; 
    483                 $pageregex = 'page/?([0-9]{1,})/?$'; 
     484                $pageregex = $this->page_number_base . '/?([0-9]{1,})/?$'; 
    484485                 
    485486                //build up an array of endpoint regexes to append => queries to append 
    486487                if ($endpoints) { 
     
    860861                        $this->root = $this->index . '/'; 
    861862                } 
    862863                $this->category_base = get_option('category_base'); 
     864                $this->author_base = trim(__('/author/'), '/'); 
     865                $this->search_base = trim(__('/search/'), '/'); 
     866                $this->comments_base = trim(__('/comments/'), '/'); 
     867                $this->feed_base = trim(__('/feed/'), '/'); 
     868                $this->page_number_base = trim(__('/page/'), '/'); 
     869 
    863870                unset($this->category_structure); 
    864871                unset($this->author_structure); 
    865872                unset($this->date_structure); 
     
    888895        } 
    889896} 
    890897 
    891 ?> 
    892  No newline at end of file 
     898?>