[wp-trac] [WordPress Trac] #54042: Extending wpdb::prepare() to support table/field names, and IN() operator

WordPress Trac noreply at wordpress.org
Sun Sep 12 16:08:28 UTC 2021


#54042: Extending wpdb::prepare() to support table/field names, and IN() operator
--------------------------+------------------------------
 Reporter:  craigfrancis  |       Owner:  (none)
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Database      |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------

Comment (by ocean90):

 Hello @craigfrancis, welcome to WordPress Trac!

 For escaping table names we already have a ticket at #52506. Would be good
 to keep the discussion in one place for this. The ticket also notes the
 potential conflicts with future `printf` formats.

 For the IN operator the coding standards recommend to use a combination of
 `implode()` and `array_fill()`, see [https://github.com/WordPress
 /WordPress-Coding-
 Standards/blob/dc2f21771cb2b5336a7e6bb6616abcdfa691d7de/WordPress/Tests/DB/PreparedSQLPlaceholdersUnitTest.inc#L70-L124
 these examples].

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


More information about the wp-trac mailing list