Make WordPress Core

Opened 7 years ago

Closed 7 years ago

#37123 closed defect (bug) (fixed)

Explicitly globalize $wpdb in either wp-settings.php or ms-settings.php

Reported by: danielbachhuber's profile danielbachhuber Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.6 Priority: normal
Severity: normal Version:
Component: Bootstrap/Load Keywords: needs-patch dev-feedback
Focuses: Cc:


ms-settings.php implicitly expects $wpdb to be a globalized variable. However, neither wp-settings.php nor ms-settings.php explicitly globalizes it, which causes a fatal when wp-settings.php is called within a function.

$wpdb should be explicitly globalized, either in wp-settings.php or ms-settings.php. I don't have a strong preference as to which.


Change History (1)

#1 @SergeyBiryukov
7 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 37864:

Database: Explicitly globalize $wpdb in wp-settings.php in case WordPress isn't loaded in global scope.

See [18993] for $table_prefix.

Props danielbachhuber.
Fixes #37123.

Note: See TracTickets for help on using tickets.