[wp-trac] [WordPress Trac] #52506: Add escaping method for table names in SQL queries

WordPress Trac noreply at wordpress.org
Sat Jan 28 20:56:24 UTC 2023


#52506: Add escaping method for table names in SQL queries
-------------------------------------------------+-------------------------
 Reporter:  tellyworth                           |       Owner:
                                                 |  davidbaumwald
     Type:  defect (bug)                         |      Status:  closed
 Priority:  normal                               |   Milestone:  6.2
Component:  Database                             |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-unit-tests early needs-docs      |     Focuses:
  has-patch needs-testing needs-dev-note         |  performance
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"55158" 55158]:
 {{{
 #!CommitTicketReference repository="" revision="55158"
 Database: Replace `substr_compare()` usage with `substr()` in
 `wpdb::prepare()`.

 This amends the previous commit to avoid a warning on PHP < 7.2.18 if
 haystack is an empty string:
 {{{
 Warning: substr_compare(): The start position cannot exceed initial string
 length
 }}}

 Follow-up to [55151], [55157].

 See #52506.
 }}}

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


More information about the wp-trac mailing list