[wp-trac] [WordPress Trac] #33372: WP_Query may return incorrect results when using negative values with parameter p.

WordPress Trac noreply at wordpress.org
Tue Jun 28 16:03:57 UTC 2016


#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:  Future
Component:  Query                                |  Release
 Severity:  normal                               |     Version:
 Keywords:  needs-patch needs-unit-tests good-   |  Resolution:
  first-bug                                      |     Focuses:
-------------------------------------------------+-------------------------

Comment (by Akeif):

 @boonebgorges We're working on a patch at work and it look like using
 intval() isn't reliable since passing objects will return 1 and thus will
 be a valid parameter.

 http://php.net/manual/en/function.intval.php

 Passing array('foo') to intval() return 1, thus return post 1.

 That beeing said, passing an object to absint() also return 1 so it's
 still an improvment.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33372#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list