Make WordPress Core

Opened 7 years ago

Last modified 3 years ago

#40779 new defect (bug)

function_exists() audit in wp-db.php

Reported by: johnjamesjacoby's profile johnjamesjacoby Owned by:
Milestone: Awaiting Review Priority: low
Severity: minor Version:
Component: Database Keywords: 2nd-opinion
Focuses: Cc:

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)


  • 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 (2)

#1 @johnjamesjacoby
7 years ago

  • Description modified (diff)

#2 @hellofromTonya
3 years ago

  • Keywords needs-testing removed

Removing needs-testing until ticket is marked as needs-patch or has-patch.

Note: See TracTickets for help on using tickets.