WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 2 years ago

#40695 new defect (bug)

`install_blog` suppresses database errors

Reported by: andy Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Database Keywords: has-patch
Focuses: multisite Cc:
PR Number:

Description

install_blog uses error suppression and DESCRIBE $table to detect the absence of tables. Error suppression can be removed in favor of SHOW TABLES LIKE $table, as in the patch on #40694.

Another source of errors in install_blog is the call to get_blogaddress_by_id. This attempts to read the site's home attribute which hits the magic WP_Site->__get, which ultimately leads to a SELECT against the non-existent options table.

Attachments (1)

d.diff (904 bytes) - added by andy 2 years ago.

Download all attachments as: .zip

Change History (7)

#1 @andy
2 years ago

  • Focuses multisite added

@andy
2 years ago

#2 @andy
2 years ago

  • Keywords has-patch added

The home attribute is used only to determine http/https. This can be avoided by inlining the rest of the logic from get_blogaddress_by_id into install_blog. Patch attached.

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


2 years ago

This ticket was mentioned in Slack in #core-multisite by andy. View the logs.


2 years ago

#5 @andy
2 years ago

This patch has been deployed on WordPress.com.

#6 @ocean90
2 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version trunk deleted
Note: See TracTickets for help on using tickets.