WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#19970 closed defect (bug) (fixed)

Self-created config file allows invalid table prefix

Reported by: rmarks Owned by: rmarks
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3.1
Component: Upgrade/Install Keywords: has-patch commit
Focuses: Cc:

Description

It's possible to manually create a wp-config.php file with an empty table prefix. This will create the tables and possible work okay as a standalone install, but this causes problems in Multisite.

Attachments (2)

19970.diff (1014 bytes) - added by rmarks 2 years ago.
19970.2.diff (2.6 KB) - added by SergeyBiryukov 2 years ago.

Download all attachments as: .zip

Change History (10)

rmarks2 years ago

comment:1 rmarks2 years ago

  • Keywords has-patch added

Attached is a patch that will abort the install if there is an empty table prefix.

comment:3 follow-up: nacin2 years ago

So we don't tank existing installs, this should only prevent it on install.php.

Good idea though.

comment:4 kurtpayne2 years ago

Should the prefix also be run through strtolower()? Related #19748

SergeyBiryukov2 years ago

comment:5 in reply to: ↑ 3 SergeyBiryukov2 years ago

  • Component changed from General to Upgrade/Install
  • Milestone changed from Awaiting Review to 3.4

Replying to nacin:

So we don't tank existing installs, this should only prevent it on install.php.

19970.2.diff is the patch for install.php. Also adds some whitespace as per coding standards.

Replying to kurtpayne:

Should the prefix also be run through strtolower()? Related #19748

I guess we should remove strtolower() in #19748.

comment:6 nacin2 years ago

  • Keywords commit added

Per bug scrub last week, ryan and I were cool with this.

comment:7 nacin2 years ago

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

In [20699]:

Issue an error during the WordPress install process if wp-config.php is configured with an empty database table prefix, which is not supported.

props SergeyBiryukov.
fixes #19970.

comment:8 nacin2 years ago

In [20700]:

A more resilient check for the base table prefix. see #19970.

Note: See TracTickets for help on using tickets.