From a39dc63ed53da490484bc0179d545dd4daa61910 Mon Sep 17 00:00:00 2001 From: nacin Date: Fri, 19 Feb 2010 20:56:16 +0000 Subject: [PATCH] Allow bypass of http call to wp.org (for keys/salts), via URL query var. See #12159 git-svn-id: http://svn.automattic.com/wordpress/trunk@13232 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/setup-config.php | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index 7954e13fd..aed18212d 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -109,7 +109,7 @@ switch($step) {

If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open wp-config-sample.php in a text editor, fill in your information, and save it as wp-config.php.

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’re all ready…

-

Let’s go!

+

Let’s go!

If you want to run multiple WordPress installations in a single database, change this. +

error) ) wp_die($wpdb->error->get_error_message()); + // Fetch or generate keys and salts. + $no_api = isset( $_POST['noapi'] ); require_once( ABSPATH . WPINC . '/plugin.php' ); - require_once( ABSPATH . WPINC . '/http.php' ); - wp_fix_server_vars(); - /**#@+ - * @ignore - */ - function get_bloginfo() { - return 'http://' . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ); + if ( ! $no_api ) { + require_once( ABSPATH . WPINC . '/http.php' ); + wp_fix_server_vars(); + /**#@+ + * @ignore + */ + function get_bloginfo() { + return ( ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . str_replace( $_SERVER['PHP_SELF'], '/wp-admin/setup-config.php', '' ) ); + } + /**#@-*/ + $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); } - /**#@-*/ - $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' ); - if ( is_wp_error( $secret_keys ) ) { + if ( $no_api || is_wp_error( $secret_keys ) ) { $secret_keys = array(); require_once( ABSPATH . WPINC . '/pluggable.php' ); for ( $i = 0; $i < 8; $i++ )