[wp-trac] [WordPress Trac] #40779: function_exists() audit in wp-db.php

WordPress Trac noreply at wordpress.org
Tue May 16 14:47:07 UTC 2017


#40779: function_exists() audit in wp-db.php
-----------------------------+---------------------------------------
 Reporter:  johnjamesjacoby  |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  low              |  Milestone:  Awaiting Review
Component:  Database         |    Version:
 Severity:  minor            |   Keywords:  needs-testing 2nd-opinion
  Focuses:                   |
-----------------------------+---------------------------------------
 A few `function_exists()` checks can be removed from `wp-db.php`, thanks
 to recent load order changes, probably nobody having looked in a while,
 and generally being afraid to break DB drop-ins:

 All of these are ahead of `require_wp_db()`:

 * `function_exists('is_multisite')` (load.php)
 * `function_exists('_deprecated_function')` (functions.php)
 * `function_exists( 'mb_strlen' )` (compat.php)
 * `mb_check_encoding()` could *maybe* be a new function in compat.php
 (it's used 3 times)

 ----

 The only caveats are 10+ year-old HyperDB versions that do the old-school
 deep-integration thing, of directly including files – they'll need extra
 scrutiny.

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


More information about the wp-trac mailing list