[wp-trac] [WordPress Trac] #21138: Comments rewrite contains bogus rule

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 2 17:45:53 UTC 2012


#21138: Comments rewrite contains bogus rule
---------------------------+------------------
 Reporter:  nacin          |       Owner:
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  3.5
Component:  Rewrite Rules  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |
---------------------------+------------------

Old description:

> {{{
> [comments/feed/(feed|rdf|rss|rss2|atom)/?$] =>
> index.php?&feed=$matches[1]&withcomments=1
> [comments/(feed|rdf|rss|rss2|atom)/?$] =>
> index.php?&feed=$matches[1]&withcomments=1
> [comments/page/?([0-9]{1,})/?$] => index.php?&paged=$matches[1]
> }}}
>
> That last rule doesn't make any sense. We should call
> generate_rewrite_rules() with $paged = false here.

New description:

 {{{
 [comments/feed/(feed|rdf|rss|rss2|atom)/?$] =>
     index.php?&feed=$matches[1]&withcomments=1

 [comments/(feed|rdf|rss|rss2|atom)/?$] =>
     index.php?&feed=$matches[1]&withcomments=1

 [comments/page/?([0-9]{1,})/?$] =>
     index.php?&paged=$matches[1]
 }}}

 That last rule doesn't make any sense. We should call
 generate_rewrite_rules() with $paged = false here.

--

Comment (by nacin):

 I found this when porting over the test_query.php unit tests:

 {{{
 // 'comments/page/?([0-9]{1,})/?$' => 'index.php?&paged=$matches[1]',
 function test_comments_page() {
        $this->http('/comments/page/2/');
        $this->assertQueryTrue('is_home', 'is_paged');
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21138#comment:1>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list