From c02d96890a814e4d0f31384d1e51621fa0377d8e Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 2 May 2012 20:37:18 +0000 Subject: [PATCH] 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. git-svn-id: http://core.svn.wordpress.org/trunk@20699 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/install.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index de683896e..2460d6d66 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -151,15 +151,20 @@ $php_compat = version_compare( $php_version, $required_php_version, '>=' ); $mysql_compat = version_compare( $mysql_version, $required_mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' ); if ( !$mysql_compat && !$php_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); + $compat = sprintf( __( 'You cannot install because WordPress %1$s requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.' ), $wp_version, $required_php_version, $required_mysql_version, $php_version, $mysql_version ); elseif ( !$php_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version ); + $compat = sprintf( __( 'You cannot install because WordPress %1$s requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version ); elseif ( !$mysql_compat ) - $compat = sprintf( __('You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version ); + $compat = sprintf( __( 'You cannot install because WordPress %1$s requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version ); if ( !$mysql_compat || !$php_compat ) { display_header(); - die('

' . __('Insufficient Requirements') . '

' . $compat . '

'); + die( '

' . __( 'Insufficient Requirements' ) . '

' . $compat . '

' ); +} + +if ( empty( $wpdb->prefix ) ) { + display_header(); + die( '

' . __( 'Configuration Error' ) . '

' . __( 'Your wp-config.php file has an empty database table prefix, which is not supported.' ) . '

' ); } switch($step) {