Make WordPress Core

Changeset 2535


Ignore:
Timestamp:
04/14/2005 04:24:22 AM (20 years ago)
Author:
ryan
Message:

Fix post paging regex to avoid regex collision between posts with slugs that differ only by a trailing number. http://mosquito.wordpress.org/view.php?id=1235

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r2523 r2535  
    253253            $q['posts_per_page'] = get_settings('posts_per_rss');
    254254            $q['what_to_show'] = 'posts';
     255        }
     256
     257        if (isset($q['page'])) {
     258            $q['page'] = trim($q['page'], '/');
     259            $q['page'] = (int) $q['page'];
    255260        }
    256261   
     
    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 {
  • trunk/wp-includes/functions.php

    r2527 r2535  
    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;
Note: See TracChangeset for help on using the changeset viewer.