[wp-trac] [WordPress Trac] #29736: Proposal to check for is_scalar() in WP_Query::fill_query_vars()

WordPress Trac noreply at wordpress.org
Mon Oct 13 19:56:49 UTC 2014


#29736: Proposal to check for is_scalar() in WP_Query::fill_query_vars()
-------------------------+------------------
 Reporter:  tivnet       |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.1
Component:  Query        |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  commit       |     Focuses:
-------------------------+------------------
Changes (by boonebgorges):

 * keywords:   => commit
 * milestone:  Awaiting Review => 4.1


Comment:

 Yes, the change looks good. [attachment:29736.patch] makes it more concise
 and adds unit tests.

 >  Of course, isset or ! empty should be checked before is_scalar,

 This shouldn't be necessary. By the time we've gotten to this point in
 `parse_query()`, the query vars have either been run through
 `fill_query_vars()`, which guarantees that 's' will be `isset()`. An
 equivalent `! empty()` check is done later on:
 https://core.trac.wordpress.org/browser/tags/4.0/src/wp-
 includes/query.php#L2655

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


More information about the wp-trac mailing list