<!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>[12760] trunk: Formatting cleanups</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12760">12760</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-19 17:01:39 +0000 (Tue, 19 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Formatting cleanups</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmsadminphp">trunk/wp-admin/ms-admin.php</a></li>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpadminmsusersphp">trunk/wp-admin/ms-users.php</a></li>
<li><a href="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.php</a></li>
<li><a href="#trunkwpincludesmssettingsphp">trunk/wp-includes/ms-settings.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminmsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-admin.php (12759 => 12760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-admin.php        2010-01-19 16:14:06 UTC (rev 12759)
+++ trunk/wp-admin/ms-admin.php        2010-01-19 17:01:39 UTC (rev 12760)
</span><span class="lines">@@ -29,7 +29,7 @@
</span><span class="cx"> ?&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;wrap&quot;&gt;
</span><del>-        &lt;h2&gt;&lt;?php echo wp_specialchars( $title ); ?&gt;&lt;/h2&gt;
</del><ins>+        &lt;h2&gt;&lt;?php echo esc_html( $title ); ?&gt;&lt;/h2&gt;
</ins><span class="cx"> 
</span><span class="cx">         &lt;ul class=&quot;subsubsub&quot;&gt;
</span><span class="cx">         &lt;li&gt;&lt;a href=&quot;ms-sites.php#form-add-blog&quot; class=&quot;rbutton&quot;&gt;&lt;strong&gt;&lt;?php _e('Create a New Blog'); ?&gt;&lt;/strong&gt;&lt;/a&gt; | &lt;/li&gt;
</span></span></pre></div>
<a id="trunkwpadminmssitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-sites.php (12759 => 12760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-19 16:14:06 UTC (rev 12759)
+++ trunk/wp-admin/ms-sites.php        2010-01-19 17:01:39 UTC (rev 12760)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">         &lt;?php
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-switch( $_GET['action'] ) {
</del><ins>+switch ( $_GET['action'] ) {
</ins><span class="cx">         // Edit blog
</span><span class="cx">         case &quot;editblog&quot;:
</span><span class="cx">                 $blog_prefix = $wpdb-&gt;get_blog_prefix( $id );
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">                                                                 &lt;select name=&quot;new_role&quot; id=&quot;new_role&quot;&gt;
</span><span class="cx">                                                                 &lt;?php
</span><span class="cx">                                                                 reset( $editblog_roles );
</span><del>-                                                                foreach( $editblog_roles as $role =&gt; $role_assoc ){
</del><ins>+                                                                foreach ( $editblog_roles as $role =&gt; $role_assoc ){
</ins><span class="cx">                                                                         $name = translate_with_context($role_assoc['name']);
</span><span class="cx">                                                                         $selected = ( $role == $editblog_default_role ) ? 'selected=&quot;selected&quot;' : '';
</span><span class="cx">                                                                         echo &quot;&lt;option {$selected} value=\&quot;&quot; . esc_attr($role) . &quot;\&quot;&gt;{$name}&lt;/option&gt;&quot;;
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;form action=&quot;ms-sites.php&quot; method=&quot;get&quot; id=&quot;ms-search&quot;&gt;
</span><span class="cx">                         &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
</span><del>-                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s, 1 ) ); ?&gt;&quot; size=&quot;17&quot; /&gt;
</del><ins>+                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s ) ); ?&gt;&quot; size=&quot;17&quot; /&gt;
</ins><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_name&quot; value=&quot;&lt;?php esc_attr_e('Search blogs by name') ?&gt;&quot; /&gt;
</span><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_id&quot; value=&quot;&lt;?php esc_attr_e('by blog ID') ?&gt;&quot; /&gt;
</span><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_ip&quot; value=&quot;&lt;?php esc_attr_e('by IP address') ?&gt;&quot; /&gt;
</span><span class="lines">@@ -442,10 +442,10 @@
</span><span class="cx">                         &lt;/thead&gt;
</span><span class="cx">                         &lt;tbody id=&quot;the-list&quot;&gt;
</span><span class="cx">                         &lt;?php
</span><del>-                        if ($blog_list) {
</del><ins>+                        if ( $blog_list ) {
</ins><span class="cx">                                 $bgcolor = $class = '';
</span><span class="cx">                                 $status_list = array( &quot;archived&quot; =&gt; &quot;#fee&quot;, &quot;spam&quot; =&gt; &quot;#faa&quot;, &quot;deleted&quot; =&gt; &quot;#f55&quot; );
</span><del>-                                foreach ($blog_list as $blog) {
</del><ins>+                                foreach ( $blog_list as $blog ) {
</ins><span class="cx">                                         $class = ('alternate' == $class) ? '' : 'alternate';
</span><span class="cx">                                         reset( $status_list );
</span><span class="cx"> 
</span><span class="lines">@@ -458,7 +458,7 @@
</span><span class="cx">                                         echo &quot;&lt;tr $bgcolour class='$class'&gt;&quot;;
</span><span class="cx"> 
</span><span class="cx">                                         $blogname = ( is_subdomain_install() ) ? str_replace('.'.$current_site-&gt;domain, '', $blog['domain']) : $blog['path'];
</span><del>-                                        foreach( $posts_columns as $column_name=&gt;$column_display_name ) {
</del><ins>+                                        foreach ( $posts_columns as $column_name=&gt;$column_display_name ) {
</ins><span class="cx">                                                 switch($column_name) {
</span><span class="cx">                                                         case 'id': ?&gt;
</span><span class="cx">                                                                 &lt;th scope=&quot;row&quot; class=&quot;check-column&quot;&gt;
</span></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-users.php (12759 => 12760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php        2010-01-19 16:14:06 UTC (rev 12759)
+++ trunk/wp-admin/ms-users.php        2010-01-19 17:01:39 UTC (rev 12760)
</span><span class="lines">@@ -104,7 +104,7 @@
</span><span class="cx">         &lt;h2&gt;&lt;?php _e( $current_site-&gt;site_name ); ?&gt; &lt;?php _e(&quot;Users&quot;); ?&gt;&lt;/h2&gt;
</span><span class="cx">         &lt;form action=&quot;ms-users.php&quot; method=&quot;get&quot; class=&quot;search-form&quot;&gt;
</span><span class="cx">                 &lt;p class=&quot;search-box&quot;&gt;
</span><del>-                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php if (isset($_GET['s'])) esc_attr( stripslashes( $s ) ); ?&gt;&quot; class=&quot;search-input&quot; id=&quot;user-search-input&quot; /&gt;
</del><ins>+                &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php if ( isset($_GET['s']) ) esc_attr( stripslashes( $s ) ); ?&gt;&quot; class=&quot;search-input&quot; id=&quot;user-search-input&quot; /&gt;
</ins><span class="cx">                 &lt;input type=&quot;submit&quot; id=&quot;post-query-submit&quot; value=&quot;&lt;?php esc_attr_e('Search Users') ?&gt;&quot; class=&quot;button&quot; /&gt;
</span><span class="cx">                 &lt;/p&gt;
</span><span class="cx">         &lt;/form&gt;
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12759 => 12760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-19 16:14:06 UTC (rev 12759)
+++ trunk/wp-includes/ms-functions.php        2010-01-19 17:01:39 UTC (rev 12760)
</span><span class="lines">@@ -444,7 +444,7 @@
</span><span class="cx">                 $blogs = get_blogs_of_user( $user_id, true ); // if a user's primary blog is shut down, check their other blogs.
</span><span class="cx">                 $ret = false;
</span><span class="cx">                 if ( is_array( $blogs ) &amp;&amp; count( $blogs ) &gt; 0 ) {
</span><del>-                        foreach( (array) $blogs as $blog_id =&gt; $blog ) {
</del><ins>+                        foreach ( (array) $blogs as $blog_id =&gt; $blog ) {
</ins><span class="cx">                                 if ( $blog-&gt;site_id != $wpdb-&gt;siteid )
</span><span class="cx">                                         continue;
</span><span class="cx">                                 $details = get_blog_details( $blog_id );
</span><span class="lines">@@ -874,7 +874,7 @@
</span><span class="cx"> 
</span><span class="cx">         if ( is_array( $banned_names ) &amp;&amp; empty( $banned_names ) == false ) {
</span><span class="cx">                 $email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
</span><del>-                foreach( (array) $banned_names as $banned_domain ) {
</del><ins>+                foreach ( (array) $banned_names as $banned_domain ) {
</ins><span class="cx">                         if ( $banned_domain == '' )
</span><span class="cx">                                 continue;
</span><span class="cx">                         if (
</span><span class="lines">@@ -2127,7 +2127,7 @@
</span><span class="cx">         // Garbage Collection
</span><span class="cx">         $rows = $wpdb-&gt;get_results( &quot;SELECT meta_key FROM {$wpdb-&gt;sitemeta} WHERE meta_key LIKE 'rss\_%\_ts' AND meta_value &lt; unix_timestamp( date_sub( NOW(), interval 7200 second ) )&quot; );
</span><span class="cx">         if ( is_array( $rows ) ) {
</span><del>-                foreach( $rows as $row ) {
</del><ins>+                foreach ( $rows as $row ) {
</ins><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$wpdb-&gt;sitemeta} WHERE meta_key = %s&quot;, $row-&gt;meta_key ) );
</span><span class="cx">                         $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;DELETE FROM {$wpdb-&gt;sitemeta} WHERE meta_key = %s&quot;, str_replace( '_ts', '', $row-&gt;meta_key ) ) );
</span><span class="cx">                 }
</span></span></pre></div>
<a id="trunkwpincludesmssettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-settings.php (12759 => 12760)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-settings.php        2010-01-19 16:14:06 UTC (rev 12759)
+++ trunk/wp-includes/ms-settings.php        2010-01-19 17:01:39 UTC (rev 12760)
</span><span class="lines">@@ -14,20 +14,20 @@
</span><span class="cx">         return false;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if( isset( $current_site ) &amp;&amp; isset( $current_blog ) )
</del><ins>+if ( isset( $current_site ) &amp;&amp; isset( $current_blog ) )
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> // deprecated
</span><span class="cx"> $wpmuBaseTablePrefix = $table_prefix;
</span><span class="cx"> 
</span><span class="cx"> $domain = addslashes( $_SERVER['HTTP_HOST'] );
</span><del>-if( substr( $domain, 0, 4 ) == 'www.' )
</del><ins>+if ( substr( $domain, 0, 4 ) == 'www.' )
</ins><span class="cx">         $domain = substr( $domain, 4 );
</span><del>-if( strpos( $domain, ':' ) ) {
-        if( substr( $domain, -3 ) == ':80' ) {
</del><ins>+if ( strpos( $domain, ':' ) ) {
+        if ( substr( $domain, -3 ) == ':80' ) {
</ins><span class="cx">                 $domain = substr( $domain, 0, -3 );
</span><span class="cx">                 $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -3 );
</span><del>-        } elseif( substr( $domain, -4 ) == ':443' ) {
</del><ins>+        } elseif ( substr( $domain, -4 ) == ':443' ) {
</ins><span class="cx">                 $domain = substr( $domain, 0, -4 );
</span><span class="cx">                 $_SERVER['HTTP_HOST'] = substr( $_SERVER['HTTP_HOST'], 0, -4 );
</span><span class="cx">         } else {
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> $domain = preg_replace('/:.*$/', '', $domain); // Strip ports
</span><del>-if( substr( $domain, -1 ) == '.' )
</del><ins>+if ( substr( $domain, -1 ) == '.' )
</ins><span class="cx">         $domain = substr( $domain, 0, -1 );
</span><span class="cx"> 
</span><span class="cx"> $path = preg_replace( '|([a-z0-9-]+.php.*)|', '', $_SERVER['REQUEST_URI'] );
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">         $current_site-&gt;site_name = wp_cache_get( $current_site-&gt;id . ':current_site_name', &quot;site-options&quot; );
</span><span class="cx">         if ( !$current_site-&gt;site_name ) {
</span><span class="cx">                 $current_site-&gt;site_name = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT meta_value FROM $wpdb-&gt;sitemeta WHERE site_id = %d AND meta_key = 'site_name'&quot;, $current_site-&gt;id ) );
</span><del>-                if( $current_site-&gt;site_name == null )
</del><ins>+                if ( $current_site-&gt;site_name == null )
</ins><span class="cx">                         $current_site-&gt;site_name = ucfirst( $current_site-&gt;domain );
</span><span class="cx">                 wp_cache_set( $current_site-&gt;id . ':current_site_name', $current_site-&gt;site_name, 'site-options');
</span><span class="cx">         }
</span><span class="lines">@@ -56,22 +56,22 @@
</span><span class="cx"> 
</span><span class="cx"> function wpmu_current_site() {
</span><span class="cx">         global $wpdb, $current_site, $domain, $path, $sites;
</span><del>-        if( defined( 'DOMAIN_CURRENT_SITE' ) &amp;&amp; defined( 'PATH_CURRENT_SITE' ) ) {
</del><ins>+        if ( defined( 'DOMAIN_CURRENT_SITE' ) &amp;&amp; defined( 'PATH_CURRENT_SITE' ) ) {
</ins><span class="cx">                 $current_site-&gt;id = (defined( 'SITE_ID_CURRENT_SITE' ) ? constant('SITE_ID_CURRENT_SITE') : 1);
</span><span class="cx">                 $current_site-&gt;domain = DOMAIN_CURRENT_SITE;
</span><span class="cx">                 $current_site-&gt;path   = $path = PATH_CURRENT_SITE;
</span><del>-                if( defined( 'BLOGID_CURRENT_SITE' ) )
</del><ins>+                if ( defined( 'BLOGID_CURRENT_SITE' ) )
</ins><span class="cx">                         $current_site-&gt;blog_id = BLOGID_CURRENT_SITE;
</span><span class="cx">                 return $current_site;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         $current_site = wp_cache_get( &quot;current_site&quot;, &quot;site-options&quot; );
</span><del>-        if( $current_site )
</del><ins>+        if ( $current_site )
</ins><span class="cx">                 return $current_site;
</span><span class="cx"> 
</span><span class="cx">         $wpdb-&gt;suppress_errors();
</span><span class="cx">         $sites = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;site&quot; ); // usually only one site
</span><del>-        if( count( $sites ) == 1 ) {
</del><ins>+        if ( count( $sites ) == 1 ) {
</ins><span class="cx">                 $current_site = $sites[0];
</span><span class="cx">                 $path = $current_site-&gt;path;
</span><span class="cx">                 $current_site-&gt;blog_id = $wpdb-&gt;get_var( &quot;SELECT blog_id FROM {$wpdb-&gt;blogs} WHERE domain='{$current_site-&gt;domain}' AND path='{$current_site-&gt;path}'&quot; );
</span><span class="lines">@@ -80,23 +80,23 @@
</span><span class="cx">                 return $current_site;
</span><span class="cx">         }
</span><span class="cx">         $path = substr( $_SERVER[ 'REQUEST_URI' ], 0, 1 + strpos( $_SERVER[ 'REQUEST_URI' ], '/', 1 ) );
</span><del>-        if( is_subdomain_install() ) {
</del><ins>+        if ( is_subdomain_install() ) {
</ins><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path = %s&quot;, $domain, $path) );
</span><del>-                if( $current_site != null )
</del><ins>+                if ( $current_site != null )
</ins><span class="cx">                         return $current_site;
</span><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path='/'&quot;, $domain) );
</span><del>-                if( $current_site != null ) {
</del><ins>+                if ( $current_site != null ) {
</ins><span class="cx">                         $path = '/';
</span><span class="cx">                         return $current_site;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $sitedomain = substr( $domain, 1 + strpos( $domain, '.' ) );
</span><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path = %s&quot;, $sitedomain, $path) );
</span><del>-                if( $current_site != null )
</del><ins>+                if ( $current_site != null )
</ins><span class="cx">                         return $current_site;
</span><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path='/'&quot;, $sitedomain) );
</span><del>-                if( $current_site == null &amp;&amp; defined( &quot;WP_INSTALLING&quot; ) == false ) {
-                        if( count( $sites ) == 1 ) {
</del><ins>+                if ( $current_site == null &amp;&amp; defined( &quot;WP_INSTALLING&quot; ) == false ) {
+                        if ( count( $sites ) == 1 ) {
</ins><span class="cx">                                 $current_site = $sites[0];
</span><span class="cx">                                 die( &quot;That blog does not exist. Please try &lt;a href='http://{$current_site-&gt;domain}{$current_site-&gt;path}'&gt;http://{$current_site-&gt;domain}{$current_site-&gt;path}&lt;/a&gt;&quot; );
</span><span class="cx">                         } else {
</span><span class="lines">@@ -107,11 +107,11 @@
</span><span class="cx">                 }
</span><span class="cx">         } else {
</span><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path = %s&quot;, $domain, $path) );
</span><del>-                if( $current_site != null )
</del><ins>+                if ( $current_site != null )
</ins><span class="cx">                         return $current_site;
</span><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE domain = %s AND path='/'&quot;, $domain) );
</span><del>-                if( $current_site == null &amp;&amp; defined( &quot;WP_INSTALLING&quot; ) == false ) {
-                        if( count( $sites ) == 1 ) {
</del><ins>+                if ( $current_site == null &amp;&amp; defined( &quot;WP_INSTALLING&quot; ) == false ) {
+                        if ( count( $sites ) == 1 ) {
</ins><span class="cx">                                 $current_site = $sites[0];
</span><span class="cx">                                 die( &quot;That blog does not exist. Please try &lt;a href='http://{$current_site-&gt;domain}{$current_site-&gt;path}'&gt;http://{$current_site-&gt;domain}{$current_site-&gt;path}&lt;/a&gt;&quot; );
</span><span class="cx">                         } else {
</span><span class="lines">@@ -125,41 +125,39 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> $current_site = wpmu_current_site();
</span><del>-if( !isset( $current_site-&gt;blog_id ) )
</del><ins>+if ( !isset( $current_site-&gt;blog_id ) )
</ins><span class="cx">         $current_site-&gt;blog_id = $wpdb-&gt;get_var( &quot;SELECT blog_id FROM {$wpdb-&gt;blogs} WHERE domain='{$current_site-&gt;domain}' AND path='{$current_site-&gt;path}'&quot; );
</span><span class="cx"> 
</span><del>-if( is_subdomain_install() ) {
</del><ins>+if ( is_subdomain_install() ) {
</ins><span class="cx">         $current_blog = wp_cache_get( 'current_blog_' . $domain, 'site-options' );
</span><del>-        if( !$current_blog ) {
</del><ins>+        if ( !$current_blog ) {
</ins><span class="cx">                 $current_blog = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;blogs WHERE domain = %s&quot;, $domain) );
</span><del>-                if( $current_blog )
</del><ins>+                if ( $current_blog )
</ins><span class="cx">                         wp_cache_set( 'current_blog_' . $domain, $current_blog, 'site-options' );
</span><span class="cx">         }
</span><del>-        if( $current_blog != null &amp;&amp; $current_blog-&gt;site_id != $current_site-&gt;id ) {
</del><ins>+        if ( $current_blog != null &amp;&amp; $current_blog-&gt;site_id != $current_site-&gt;id )
</ins><span class="cx">                 $current_site = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;site WHERE id = %d&quot;, $current_blog-&gt;site_id) );
</span><del>-        } else {
</del><ins>+        else
</ins><span class="cx">                 $blogname = substr( $domain, 0, strpos( $domain, '.' ) );
</span><del>-        }
</del><span class="cx"> } else {
</span><span class="cx">         $blogname = htmlspecialchars( substr( $_SERVER[ 'REQUEST_URI' ], strlen( $path ) ) );
</span><del>-        if( strpos( $blogname, '/' ) )
</del><ins>+        if ( strpos( $blogname, '/' ) )
</ins><span class="cx">                 $blogname = substr( $blogname, 0, strpos( $blogname, '/' ) );
</span><del>-        if( strpos( &quot; &quot;.$blogname, '?' ) )
</del><ins>+        if ( strpos( &quot; &quot;.$blogname, '?' ) )
</ins><span class="cx">                 $blogname = substr( $blogname, 0, strpos( $blogname, '?' ) );
</span><span class="cx">         $reserved_blognames = array( 'page', 'comments', 'blog', 'wp-admin', 'wp-includes', 'wp-content', 'files', 'feed' );
</span><del>-        if ( $blogname != '' &amp;&amp; !in_array( $blogname, $reserved_blognames ) &amp;&amp; !is_file( $blogname ) ) {
</del><ins>+        if ( $blogname != '' &amp;&amp; !in_array( $blogname, $reserved_blognames ) &amp;&amp; !is_file( $blogname ) )
</ins><span class="cx">                 $path = $path . $blogname . '/';
</span><del>-        }
</del><span class="cx">         $current_blog = wp_cache_get( 'current_blog_' . $domain . $path, 'site-options' );
</span><del>-        if( !$current_blog ) {
</del><ins>+        if ( !$current_blog ) {
</ins><span class="cx">                 $current_blog = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;blogs WHERE domain = %s AND path = %s&quot;, $domain, $path) );
</span><del>-                if( $current_blog )
</del><ins>+                if ( $current_blog )
</ins><span class="cx">                         wp_cache_set( 'current_blog_' . $domain . $path, $current_blog, 'site-options' );
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if( defined( &quot;WP_INSTALLING&quot; ) == false &amp;&amp; is_subdomain_install() &amp;&amp; !is_object( $current_blog ) ) {
-        if( defined( 'NOBLOGREDIRECT' ) ) {
</del><ins>+if ( defined( &quot;WP_INSTALLING&quot; ) == false &amp;&amp; is_subdomain_install() &amp;&amp; !is_object( $current_blog ) ) {
+        if ( defined( 'NOBLOGREDIRECT' ) ) {
</ins><span class="cx">                 $destination = constant( 'NOBLOGREDIRECT' );
</span><span class="cx">                 if ( $destination == '%siteurl%' )
</span><span class="cx">                         $destination = &quot;http://&quot; . $current_site-&gt;domain . $current_site-&gt;path;
</span><span class="lines">@@ -172,65 +170,64 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-if( defined( &quot;WP_INSTALLING&quot; ) == false ) {
-        if( $current_site &amp;&amp; $current_blog == null ) {
-                if( $current_site-&gt;domain != $_SERVER[ 'HTTP_HOST' ] ) {
</del><ins>+if ( defined( &quot;WP_INSTALLING&quot; ) == false ) {
+        if ( $current_site &amp;&amp; $current_blog == null ) {
+                if ( $current_site-&gt;domain != $_SERVER[ 'HTTP_HOST' ] ) {
</ins><span class="cx">                         header( &quot;Location: http://&quot; . $current_site-&gt;domain . $current_site-&gt;path );
</span><span class="cx">                         exit;
</span><span class="cx">                 }
</span><span class="cx">                 $current_blog = $wpdb-&gt;get_row( $wpdb-&gt;prepare(&quot;SELECT * FROM $wpdb-&gt;blogs WHERE domain = %s AND path = %s&quot;, $current_site-&gt;domain, $current_site-&gt;path) );
</span><span class="cx">         }
</span><del>-        if( $current_blog == false || $current_site == false )
</del><ins>+        if ( $current_blog == false || $current_site == false )
</ins><span class="cx">                 is_installed();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> $blog_id = $current_blog-&gt;blog_id;
</span><span class="cx"> $public  = $current_blog-&gt;public;
</span><span class="cx"> 
</span><del>-if( $current_blog-&gt;site_id == 0 || $current_blog-&gt;site_id == '' )
</del><ins>+if ( $current_blog-&gt;site_id == 0 || $current_blog-&gt;site_id == '' )
</ins><span class="cx">         $current_blog-&gt;site_id = 1;
</span><span class="cx"> $site_id = $current_blog-&gt;site_id;
</span><span class="cx"> 
</span><span class="cx"> $current_site = get_current_site_name( $current_site );
</span><span class="cx"> 
</span><del>-if( $blog_id == false ) {
</del><ins>+if ( $blog_id == false ) {
</ins><span class="cx">     // no blog found, are we installing? Check if the table exists.
</span><span class="cx">     if ( defined('WP_INSTALLING') ) {
</span><del>-        $blog_id = $wpdb-&gt;get_var( &quot;SELECT blog_id FROM $wpdb-&gt;blogs LIMIT 0,1&quot; );
-        if( $blog_id == false ) {
-            // table doesn't exist. This is the first blog
-            $blog_id = 1;
-        } else {
-            // table exists
-            // don't create record at this stage. we're obviously installing so it doesn't matter what the table vars below are like.
-            // default to using the &quot;main&quot; blog.
-            $blog_id = 1;
-        }
-        $current_blog-&gt;blog_id = $blog_id;
</del><ins>+                $blog_id = $wpdb-&gt;get_var( &quot;SELECT blog_id FROM $wpdb-&gt;blogs LIMIT 0,1&quot; );
+                if ( $blog_id == false ) {
+                    // table doesn't exist. This is the first blog
+                    $blog_id = 1;
+                } else {
+                    // table exists
+                    // don't create record at this stage. we're obviously installing so it doesn't matter what the table vars below are like.
+                    // default to using the &quot;main&quot; blog.
+                    $blog_id = 1;
+                }
+                $current_blog-&gt;blog_id = $blog_id;
</ins><span class="cx">     } else {
</span><del>-        $check = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;site&quot; );
-        if( $check == false ) {
-            $msg = ': DB Tables Missing';
-        } else {
-            $msg = '';
-        }
-        die( &quot;No Blog by that name on this system.&quot; . $msg );
</del><ins>+                $check = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;site&quot; );
+                if ( $check == false )
+                    $msg = ': DB Tables Missing';
+                else
+                    $msg = '';
+                die( &quot;No Blog by that name on this system.&quot; . $msg );
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> $wpdb-&gt;suppress_errors( false );
</span><span class="cx"> 
</span><del>-if( '0' == $current_blog-&gt;public ) {
</del><ins>+if ( '0' == $current_blog-&gt;public ) {
</ins><span class="cx">         // This just means the blog shouldn't show up in google, etc. Only to registered members
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> function is_installed() {
</span><span class="cx">         global $wpdb, $domain, $path;
</span><span class="cx">         $base = stripslashes( $base );
</span><del>-        if( defined( &quot;WP_INSTALLING&quot; ) == false ) {
</del><ins>+        if ( defined( &quot;WP_INSTALLING&quot; ) == false ) {
</ins><span class="cx">                 $check = $wpdb-&gt;get_results( &quot;SELECT * FROM $wpdb-&gt;site&quot; );
</span><span class="cx">                 $msg = &quot;If your blog does not display, please contact the owner of this site.&lt;br /&gt;&lt;br /&gt;If you are the owner of this site please check that MySQL is running properly and all tables are error free.&lt;br /&gt;&lt;br /&gt;&quot;;
</span><del>-                if( $check == false ) {
</del><ins>+                if ( $check == false ) {
</ins><span class="cx">                         $msg .= &quot;&lt;strong&gt;Database Tables Missing.&lt;/strong&gt;&lt;br /&gt;Database tables are missing. This means that MySQL is either not running, WPMU was not installed properly, or someone deleted {$wpdb-&gt;site}. You really &lt;em&gt;should&lt;/em&gt; look at your database now.&lt;br /&gt;&quot;;
</span><span class="cx">                 } else {
</span><span class="cx">                         $msg .= '&lt;strong&gt;Could Not Find Blog!&lt;/strong&gt;&lt;br /&gt;';
</span><span class="lines">@@ -247,7 +244,7 @@
</span><span class="cx">                         &lt;li&gt; $wpdb-&gt;sitecategories &lt;/li&gt;
</span><span class="cx">                         &lt;/ul&gt;&quot;;
</span><span class="cx">                 $msg .= &quot;If you suspect a problem please report it to the support forums but you must include the information asked for in the &lt;a href='http://codex.wordpress.org/Debugging_WPMU'&gt;WPMU bug reporting guidelines&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;&quot;;
</span><del>-                if( is_file( 'release-info.txt' ) ) {
</del><ins>+                if ( is_file( 'release-info.txt' ) ) {
</ins><span class="cx">                         $msg .= 'Your bug report must include the following text: &quot;';
</span><span class="cx">                         $info = file( 'release-info.txt' );
</span><span class="cx">                         $msg .= $info[ 4 ] . '&quot;';
</span></span></pre>
</div>
</div>

</body>
</html>