Make WordPress Core


Ignore:
Timestamp:
07/03/2014 07:56:37 PM (12 years ago)
Author:
nacin
Message:

Simplify the setup-config.php UI flow and load process.

When no configuration file is detected, we now redirect to setup-config.php. This process now uses the WordPress bootstrap, rather than a set of fragile hacks.

fixes #28740.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-load.php

    r25396 r28978  
    3939
    4040        define( 'WPINC', 'wp-includes' );
    41         define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
    4241        require_once( ABSPATH . WPINC . '/load.php' );
    43         require_once( ABSPATH . WPINC . '/version.php' );
    44 
    45         wp_check_php_mysql_versions();
    46         wp_load_translations_early();
    4742
    4843        // Standardize $_SERVER variables across setups.
    … …  
    5247
    5348        $path = wp_guess_url() . '/wp-admin/setup-config.php';
     49
     50        /* We're going to redirect to setup-config.php. While this shouldn't result
     51         * in an infinite loop, that's a silly thing to assume, don't you think? If
     52         * we're traveling in circles, our last-ditch effort is "Need more help?"
     53         */
     54        if ( false === strpos( $_SERVER['REQUEST_URI'], 'setup-config' ) ) {
     55                header( 'Location: ' . $path );
     56                exit;
     57        }
     58
     59        define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );
     60        require_once( ABSPATH . WPINC . '/version.php' );
     61
     62        wp_check_php_mysql_versions();
     63        wp_load_translations_early();
    5464
    5565        // Die with an error message
Note: See TracChangeset for help on using the changeset viewer.