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

WordPress Trac noreply at wordpress.org
Tue Mar 30 10:01:00 UTC 2021


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

 * keywords:  has-patch needs-refresh => has-patch has-screenshots
 * milestone:  Future Release => 5.8


Comment:

 In `17737.7.diff`:
 - I refreshed the patch against trunk
 - I added one more `is_scalar()` check for `author` (see @dd32’s comment)

 Moving this ticket for 5.8 consideration.

 Replying to [comment:42 dd32]:
 > Replying to [comment:41 tellyworth]:
 > > * `cat` and `author` both permit arrays, but they do it in an implicit
 way thanks to `preg_replace()`'s support for arrays in the `subject`
 param.
 >
 > Looks like any array support for `author` has been broken for at least
 14 years, I traced it being treated as a string back that far (and then
 gave up). It passes through the `preg_replace` but will hit a
 [https://core.trac.wordpress.org/browser/trunk/src/wp-includes/class-wp-
 query.php?marks=2227&rev=47557#L2220 urldecode down here]. `cat` does
 support arrays, and it's not-so-implicitely handled by merging arrays back
 to a comma string.

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


More information about the wp-trac mailing list