[wp-trac] [WordPress Trac] #37499: WP_User_Query:prepare_query() bug leads to user meta query with blog_id 0

WordPress Trac noreply at wordpress.org
Thu Jul 28 18:25:21 UTC 2016


#37499: WP_User_Query:prepare_query() bug leads to user meta query with blog_id 0
-------------------------------------------------+-------------------------
 Reporter:  stephdau                             |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.6
Component:  Users                                |     Version:  trunk
 Severity:  normal                               |  Resolution:
 Keywords:  needs-patch needs-unit-tests         |     Focuses:  multisite
  reporter-feedback                              |
-------------------------------------------------+-------------------------

Comment (by stephdau):

 @boonebgorges: OK, got it, it's more subtle than that. :)

 In my case, the "issue" was brought up by a query analyzing tool we use,
 hooking into `WP_User_Query:prepare_query()`. It gets triggered because
 the query is being prepared as stated, but the query is ultimately not run
 in the method, thanks to further `if ( $blog_id &&` tests. It gets tripped
 because there is now potential for the query to be run, not because it
 actually is.

 So, it's not a problem as the method currently stands, but might be
 something to think about as far as its maintainability in a cooperative
 OSS project, as it's probably pretty prone to future errors. :)

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


More information about the wp-trac mailing list