[wp-trac] [WordPress Trac] #33372: WP_Query may return incorrect results when using negative values with parameter p.
WordPress Trac
noreply at wordpress.org
Fri Aug 14 09:34:18 UTC 2015
#33372: WP_Query may return incorrect results when using negative values with
parameter p.
--------------------------+-----------------------------
Reporter: giantrobot | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
In parse_query(), parameter "p" is passed through absint(), thus
converting negative post IDs to positive ones.
For example, querying for a post with id -1 will return a post with id 1
(if it exists), which is incorrect.
That behaviour is not expected or documented.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33372>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list