Make WordPress Core

Ticket #1235: paging_regex.diff

File paging_regex.diff, 1.4 KB (added by MC_incubus, 21 years ago)
  • wp-includes/classes.php

     
    253253                        $q['posts_per_page'] = get_settings('posts_per_rss');
    254254                        $q['what_to_show'] = 'posts';
    255255                }
     256
     257                if (isset($q['page'])) {
     258                        $q['page'] = trim($q['page'], '/');
     259                        $q['page'] = (int) $q['page'];
     260                }
    256261       
    257262                $add_hours = intval(get_settings('gmt_offset'));
    258263                $add_minutes = intval(60 * (get_settings('gmt_offset') - $add_hours));
     
    11231128                                        $post = 1;
    11241129                                        $trackbackmatch = $match . $trackbackregex;
    11251130                                        $trackbackquery = $trackbackindex . '?' . $query . '&tb=1';
    1126                                         $match = $match . '?([0-9]+)?/?$';
     1131                                        $match = rtrim($match, '/');
     1132                                        $match = $match . '(/[0-9]+)?/?$';
    11271133                                        $query = $index . '?' . $query . '&page=' . $this->preg_index($num_toks + 1);
    11281134                                } else {
    11291135                                        $match .= '?$';
  • wp-includes/functions.php

     
    879879        $day = mysql2date('d.m.y', $post->post_date);
    880880        $currentmonth = mysql2date('m', $post->post_date);
    881881        $numpages = 1;
     882        $page = get_query_var('page');
    882883        if (!$page)
    883884                $page = 1;
    884         if (isset($p))
     885        if (is_single() || is_page())
    885886                $more = 1;
    886887        $content = $post->post_content;
    887888        if (preg_match('/<!--nextpage-->/', $content)) {