<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13232] trunk/wp-admin/setup-config.php: Allow bypass of http call to wp.
 org (for keys/salts), via URL query var.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13232">13232</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-02-19 20:56:16 +0000 (Fri, 19 Feb 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Allow bypass of http call to wp.org (for keys/salts), via URL query var. See <a href="http://trac.wordpress.org/ticket/12159">#12159</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminsetupconfigphp">trunk/wp-admin/setup-config.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminsetupconfigphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/setup-config.php (13231 => 13232)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/setup-config.php        2010-02-19 20:27:56 UTC (rev 13231)
+++ trunk/wp-admin/setup-config.php        2010-02-19 20:56:16 UTC (rev 13232)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx"> &lt;p&gt;&lt;strong&gt;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 &lt;code&gt;wp-config-sample.php&lt;/code&gt; in a text editor, fill in your information, and save it as &lt;code&gt;wp-config.php&lt;/code&gt;. &lt;/strong&gt;&lt;/p&gt;
</span><span class="cx"> &lt;p&gt;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&amp;#8217;re all ready&amp;hellip;&lt;/p&gt;
</span><span class="cx"> 
</span><del>-&lt;p class=&quot;step&quot;&gt;&lt;a href=&quot;setup-config.php?step=1&quot; class=&quot;button&quot;&gt;Let&amp;#8217;s go!&lt;/a&gt;&lt;/p&gt;
</del><ins>+&lt;p class=&quot;step&quot;&gt;&lt;a href=&quot;setup-config.php?step=1&lt;?php if ( isset( $_GET['noapi'] ) ) echo '&amp;amp;noapi'; ?&gt;&quot; class=&quot;button&quot;&gt;Let&amp;#8217;s go!&lt;/a&gt;&lt;/p&gt;
</ins><span class="cx"> &lt;?php
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="lines">@@ -145,6 +145,7 @@
</span><span class="cx">                         &lt;td&gt;If you want to run multiple WordPress installations in a single database, change this.&lt;/td&gt;
</span><span class="cx">                 &lt;/tr&gt;
</span><span class="cx">         &lt;/table&gt;
</span><ins>+        &lt;?php if ( isset( $_GET['noapi'] ) ) { ?&gt;&lt;input name=&quot;noapi&quot; type=&quot;hidden&quot; value=&quot;true&quot; /&gt;&lt;?php } ?&gt;
</ins><span class="cx">         &lt;p class=&quot;step&quot;&gt;&lt;input name=&quot;submit&quot; type=&quot;submit&quot; value=&quot;Submit&quot; class=&quot;button&quot; /&gt;&lt;/p&gt;
</span><span class="cx"> &lt;/form&gt;
</span><span class="cx"> &lt;?php
</span><span class="lines">@@ -173,19 +174,23 @@
</span><span class="cx">         if ( !empty($wpdb-&gt;error) )
</span><span class="cx">                 wp_die($wpdb-&gt;error-&gt;get_error_message());
</span><span class="cx"> 
</span><ins>+        // Fetch or generate keys and salts.
+        $no_api = isset( $_POST['noapi'] );
</ins><span class="cx">         require_once( ABSPATH . WPINC . '/plugin.php' );
</span><del>-        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', '' );
</del><ins>+        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/' );
</ins><span class="cx">         }
</span><del>-        /**#@-*/
</del><span class="cx"> 
</span><del>-        $secret_keys = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );
-        if ( is_wp_error( $secret_keys ) ) {
</del><ins>+        if ( $no_api || is_wp_error( $secret_keys ) ) {
</ins><span class="cx">                 $secret_keys = array();
</span><span class="cx">                 require_once( ABSPATH . WPINC . '/pluggable.php' );
</span><span class="cx">                 for ( $i = 0; $i &lt; 8; $i++ )
</span></span></pre>
</div>
</div>

</body>
</html>