[wp-trac] [WordPress Trac] #42284: Stop invalid query generation in WP_Site_Query

WordPress Trac noreply at wordpress.org
Thu Oct 19 20:09:46 UTC 2017


#42284: Stop invalid query generation in WP_Site_Query
--------------------------------+-----------------------------
 Reporter:  spacedmonkey        |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Networks and Sites  |    Version:  4.6
 Severity:  normal              |   Keywords:
  Focuses:  multisite           |
--------------------------------+-----------------------------
 In WP_Site_Query, developers have the ability to query by a single value
 or by multiple using a `__in` param. An example of which is which is
 `domain` and `domain__in`. Take for example the following query.

 `
 get_sites(['domain' => 'test.local', 'domain__in' => ['lebowski.local',
 'start.test.local']]);
 `

 This query will only results for test.local, completely ignoring the
 `domain__in`. This is because of the query it generates. That looks like
 this

 ` domain = 'test.local' AND domain IN ('lebowski.local',
 'start.test.local')`

 Improved error checking must be implemented on this code to stop invalid
 queries.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/42284>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list