WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#40779 new defect (bug)

function_exists() audit in wp-db.php

Reported by: johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: low
Severity: minor Version:
Component: Database Keywords: needs-testing 2nd-opinion
Focuses: Cc:
PR Number:

Description (last modified by johnjamesjacoby)

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 functions are in files now loaded ahead of require_wp_db():

  • is_multisite (load.php)
  • _deprecated_function (functions.php)
  • mb_strlen (compat.php)

Bonus:

  • mb_check_encoding() could *maybe* be a new function in compat.php (it's used 3 times in core, using @ or function_exists)

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

Change History (1)

#1 @johnjamesjacoby
2 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.