WordPress.org

Make WordPress Core

Changeset 13232


Ignore:
Timestamp:
02/19/2010 08:56:16 PM (10 years ago)
Author:
nacin
Message:

Allow bypass of http call to wp.org (for keys/salts), via URL query var. See #12159

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/setup-config.php

    r13163 r13232  
    110110<p>In all likelihood, these items were supplied to you by your Web Host. If you do not have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;</p>
    111111
    112 <p class="step"><a href="setup-config.php?step=1" class="button">Let&#8217;s go!</a></p>
     112<p class="step"><a href="setup-config.php?step=1<?php if ( isset( $_GET['noapi'] ) ) echo '&amp;noapi'; ?>" class="button">Let&#8217;s go!</a></p>
    113113<?php
    114114    break;
     
    146146        </tr>
    147147    </table>
     148    <?php if ( isset( $_GET['noapi'] ) ) { ?><input name="noapi" type="hidden" value="true" /><?php } ?>
    148149    <p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p>
    149150</form>
     
    174175        wp_die($wpdb->error->get_error_message());
    175176
     177    // Fetch or generate keys and salts.
     178    $no_api = isset( $_POST['noapi'] );
    176179    require_once( ABSPATH . WPINC . '/plugin.php' );
    177     require_once( ABSPATH . WPINC . '/http.php' );
    178     wp_fix_server_vars();
    179     /**#@+
    180      * @ignore
    181      */
    182     function get_bloginfo() {
    183         return 'http://' . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' );
     180    if ( ! $no_api ) {
     181        require_once( ABSPATH . WPINC . '/http.php' );
     182        wp_fix_server_vars();
     183        /**#@+
     184         * @ignore
     185         */
     186        function get_bloginfo() {
     187            return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) );
     188        }
     189        /**#@-*/
     190        $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
    184191    }
    185     /**#@-*/
    186 
    187     $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
    188     if ( is_wp_error( $secret_keys ) ) {
     192
     193    if ( $no_api || is_wp_error( $secret_keys ) ) {
    189194        $secret_keys = array();
    190195        require_once( ABSPATH . WPINC . '/pluggable.php' );
Note: See TracChangeset for help on using the changeset viewer.