[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 Aug 2 15:24: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:  good-first-bug has-patch has-unit-   |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by Akeif):

 The logic doesn't make sense to me but, I'm not sure what is the correct
 way of completing this fix.

 @boonebgorges Do we need to give a value to `$qv['p']` when we set
 `$qv['error'] = 404`? If `$qv['p']` need to be set should we set it to `0`
 in the case of a `404`?

 What I understand is, if the value is not a positive scalar value, we
 should throw a 404. In which case, if validation passes, the `intval()` is
 useless since we know it's a positive scalar.

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


More information about the wp-trac mailing list