X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/784f914b1e4b1c62d6657e86397c2e83bcee4295..e3ff8f35458a959c1879c0a4976701ed8dcfe651:/wp-admin/setup-config.php diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index befa6937..1404c325 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -5,8 +5,6 @@ * The permissions for the base directory must allow for writing files in order * for the wp-config.php to be created using this page. * - * @internal This file must be parsable by PHP4. - * * @package WordPress * @subpackage Administration */ @@ -28,7 +26,9 @@ define('WP_SETUP_CONFIG', true); */ error_reporting(0); -define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); +if ( ! defined( 'ABSPATH' ) ) { + define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' ); +} require( ABSPATH . 'wp-settings.php' ); @@ -99,7 +99,7 @@ function setup_config_display_header( $body_classes = array() ) { - + error ) ) wp_die( $wpdb->error->get_error_message() . $tryagain_link ); + $wpdb->query( "SELECT $prefix" ); + if ( ! $wpdb->last_error ) { + // MySQL was able to parse the prefix as a value, which we don't want. Bail. + wp_die( __( 'ERROR: "Table Prefix" is invalid.' ) ); + } + // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). try { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|'; @@ -308,7 +314,6 @@ switch($step) { } $key = 0; - // Not a PHP5-style by-reference foreach, as this file must be parseable by PHP4. foreach ( $config_file as $line_num => $line ) { if ( '$table_prefix =' == substr( $line, 0, 16 ) ) { $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n";