Opened 9 years ago
Last modified 9 years ago
#40695 new defect (bug)
`install_blog` suppresses database errors
| Reported by: | andy | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Database | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
The
homeattribute is used only to determine http/https. This can be avoided by inlining the rest of the logic fromget_blogaddress_by_idintoinstall_blog. Patch attached.