[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:06:34 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 kouratoras):
Replying to [comment:14 Akeif]:
> @kouratoras Why test `is_object()` and `!is_scalar()`? `is_scalar()`
should return `false` on an object right?
Correct, `is_scalar()` returns `false` on an object.
But, I am also checking `is_object()` and setting `p=1` before that, in
order not to apply `intval()` directly to an object.
PHP manual says:
intval() should not be used on objects, as doing so will emit an E_NOTICE
level error and return 1.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33372#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list