[wp-trac] [WordPress Trac] #36403: Incorrect use of E_USER_NOTICE in wpdb::_real_escape()

WordPress Trac noreply at wordpress.org
Sat Apr 2 11:26:07 UTC 2016


#36403: Incorrect use of E_USER_NOTICE in wpdb::_real_escape()
----------------------------+----------------------------------------
 Reporter:  SergeyBiryukov  |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Database        |    Version:  3.6
 Severity:  normal          |   Keywords:  needs-patch good-first-bug
  Focuses:                  |
----------------------------+----------------------------------------
 in [source:tags/4.4.2/src/wp-includes/wp-db.php?marks=1136,1138#L1113
 wpdb::_real_escape()], the last parameter for `_doing_it_wrong()` calls is
 `E_USER_NOTICE`, which leads to the following message:
  wpdb must set a database connection for use with escaping. This message
 was added in version 1024.

 It was apparently influenced by [http://php.net/manual/en/function
 .trigger-error.php trigger_error()]. For
 [https://developer.wordpress.org/reference/functions/_doing_it_wrong/
 _doing_it_wrong()], however, the last parameter should be the version of
 WordPress where the message was added, i.e. `'3.6'`.

 Introduced in [24758].

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


More information about the wp-trac mailing list