WordPress.org

Make WordPress Core


Ignore:
Timestamp:
04/14/2005 04:24:22 AM (16 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

File:
1 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 {
Note: See TracChangeset for help on using the changeset viewer.