Make WordPress Core

Changeset 20699


Ignore:
Timestamp:
05/02/2012 08:37:18 PM (13 years ago)
Author:
nacin
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/install.php

    r20618 r20699  
    152152
    153153if ( !$mysql_compat && !$php_compat )
    154     $compat = sprintf( __('You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 );
     154    $compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> 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 );
    155155elseif ( !$php_compat )
    156     $compat = sprintf( __('You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $wp_version, $required_php_version, $php_version );
     156    $compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_php_version, $php_version );
    157157elseif ( !$mysql_compat )
    158     $compat = sprintf( __('You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $wp_version, $required_mysql_version, $mysql_version );
     158    $compat = sprintf( __( 'You cannot install because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.' ), $wp_version, $required_mysql_version, $mysql_version );
    159159
    160160if ( !$mysql_compat || !$php_compat ) {
    161161    display_header();
    162     die('<h1>' . __('Insufficient Requirements') . '</h1><p>' . $compat . '</p></body></html>');
     162    die( '<h1>' . __( 'Insufficient Requirements' ) . '</h1><p>' . $compat . '</p></body></html>' );
     163}
     164
     165if ( empty( $wpdb->prefix ) ) {
     166    display_header();   
     167    die( '<h1>' . __( 'Configuration Error' ) . '</h1><p>' . __( 'Your <code>wp-config.php</code> file has an empty database table prefix, which is not supported.' ) . '</p></body></html>' );
    163168}
    164169
Note: See TracChangeset for help on using the changeset viewer.