Make WordPress Core

Opened 13 months ago

Last modified 13 months ago

#51779 new defect (bug)

wpdb->get_blog_prefix() doesn't allow wp_1_tablename structures

Reported by: MadtownLems Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: multisite Cc:


Context: We have some OLD networks (10+ years, started as WPMU, etc)

In the process of dropping our Domain Mapping plugin for WordPress's native support, I encountered the following problem. Some (probably very few) old networks have the root site's tables as wp_1_options (instead of wp_options).

if ( defined( 'MULTISITE' ) && ( 0 === $blog_id || 1 === $blog_id ) ) {
     return $this->base_prefix;

This logic explicitly prevents wp_1_options and friends as being queried, with requests to the root/base site going to wp_options (which doesn't exist).

Perhaps there could be some kind of sanity check that checks for the existence of tables with the prefix in this kind of situation?

Change History (1)

#1 @johnbillion
13 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.