[wp-trac] [WordPress Trac] #11694: WP should do sanity checks for paginated posts, pages and comments
WordPress Trac
noreply at wordpress.org
Thu Sep 24 14:03:07 UTC 2015
#11694: WP should do sanity checks for paginated posts, pages and comments
---------------------------------+-----------------------------
Reporter: Denis-de-Bernardy | Owner: wonderboymusic
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 4.4
Component: Posts, Post Types | Version: 2.9
Severity: major | Resolution:
Keywords: has-patch 3.9-early | Focuses: template
---------------------------------+-----------------------------
Comment (by wonderboymusic):
In [changeset:"34492"]:
{{{
#!CommitTicketReference repository="" revision="34492"
Canonical/Rewrite: sanity check posts that are paged with `<!--
nextpage-->`. Page numbers past the max number of pages are returning the
last page of content and causing infinite duplicate content.
Awesome rewrite bug: the `page` query var was being set to `'/4'` in
`$wp`. When cast to `int`, it returns `0` (Bless you, PHP). `WP_Query`
calls `trim( $page, '/' )` when setting its own query var. The few places
that were checking `page` before posts were queried now have sanity
checks, so that these changes work without flushing rewrites.
Adds/updates unit tests.
Props wonderboymusic, dd32.
See #11694.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/11694#comment:33>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list