X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/8f374b7233bc2815ccc387e448d208c5434eb961..00dbffaf1593b0ac719d98f00839221a9ca52133:/wp-admin/setup-config.php diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 6201b004..7409d010 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -44,12 +44,14 @@ define('WP_DEBUG', false); require(ABSPATH . WPINC . '/load.php'); require(ABSPATH . WPINC . '/version.php'); -// Also loads functions.php, plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php) -wp_load_translations_early(); - // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions(); +require_once(ABSPATH . WPINC . '/functions.php'); + +// Also loads plugin.php, l10n.php, pomo/mo.php (all required by setup-config.php) +wp_load_translations_early(); + // Turn register_globals off. wp_unregister_GLOBALS(); @@ -83,7 +85,7 @@ $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : 0; * @package WordPress * @subpackage Installer_WP_Config */ -function display_header() { +function setup_config_display_header() { global $wp_version; header( 'Content-Type: text/html; charset=utf-8' ); @@ -94,16 +96,17 @@ function display_header() { <?php _e( 'WordPress › Setup Configuration File' ); ?> + -> -

WordPress

+ +

@@ -114,18 +117,18 @@ switch($step) {
  • -

    wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php." ); ?>

    +

    wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php." ); ?>

    -

    +

    -

    +

    @@ -154,7 +157,7 @@ switch($step) {
    -

    +

    ' . __( 'Try Again' ) . ''; + $tryagain_link = '

    ' . __( 'Try again' ) . ''; if ( empty( $prefix ) ) wp_die( __( 'ERROR: "Table Prefix" must not be empty.' . $tryagain_link ) ); @@ -217,9 +220,10 @@ switch($step) { } $key = 0; - foreach ( $config_file as &$line ) { + // 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 ) ) { - $line = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; + $config_file[ $line_num ] = '$table_prefix = \'' . addcslashes( $prefix, "\\'" ) . "';\r\n"; continue; } @@ -234,7 +238,7 @@ switch($step) { case 'DB_USER' : case 'DB_PASSWORD' : case 'DB_HOST' : - $line = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n"; + $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n"; break; case 'AUTH_KEY' : case 'SECURE_AUTH_KEY' : @@ -244,24 +248,31 @@ switch($step) { case 'SECURE_AUTH_SALT' : case 'LOGGED_IN_SALT' : case 'NONCE_SALT' : - $line = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n"; + $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . $secret_keys[$key++] . "');\r\n"; break; } } unset( $line ); if ( ! is_writable(ABSPATH) ) : - display_header(); + setup_config_display_header(); ?> -

    wp-config.php file." ); ?>

    +

    wp-config.php file." ); ?>

    wp-config.php manually and paste the following text into it.' ); ?>

    - -

    -

    +

    +

    + -

    +

    -

    +