[wp-trac] [WordPress Trac] #17737: Be better at forcing data types for query vars

WordPress Trac noreply at wordpress.org
Thu Sep 12 03:13:06 UTC 2013

#17737: Be better at forcing data types for query vars
 Reporter:  juliobox      |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.7
Component:  Query         |     Version:  3.0
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |
Changes (by SergeyBiryukov):

 * keywords:  needs-patch => has-patch


 Replying to [comment:16 nacin]:
 > If something that isn't supposed to be an array, *is* an array, seems
 like it is an invalid input all together and should be unset.

 The checks if a query var is set are a bit inconsistent: sometimes it's
 `'' != $qv`, other times it's `! empty()` or `isset()`. Looks like an
 unset may not always be appropriate.

 [attachment:17737.5.patch] adds an `is_array()` check to some existing
 conditions and assignments that cause a notice.

Ticket URL: <http://core.trac.wordpress.org/ticket/17737#comment:17>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list