Make WordPress Core

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#19970 closed defect (bug) (fixed)

Self-created config file allows invalid table prefix

Reported by: rmarks's profile rmarks Owned by: rmarks's profile 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 13 years ago.
19970.2.diff (2.6 KB) - added by SergeyBiryukov 13 years ago.

Download all attachments as: .zip

Change History (10)

@rmarks
13 years ago

#1 @rmarks
13 years ago

  • Keywords has-patch added

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

#3 follow-up: @nacin
13 years ago

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

Good idea though.

#4 @kurtpayne
13 years ago

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

#5 in reply to: ↑ 3 @SergeyBiryukov
13 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.

#6 @nacin
12 years ago

  • Keywords commit added

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

#7 @nacin
12 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.

#8 @nacin
12 years ago

In [20700]:

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

Note: See TracTickets for help on using tickets.