<!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"> ?>
</span><span class="cx">
</span><span class="cx"> <div class="wrap">
</span><del>-        <h2><?php echo wp_specialchars( $title ); ?></h2>
</del><ins>+        <h2><?php echo esc_html( $title ); ?></h2>
</ins><span class="cx">
</span><span class="cx">         <ul class="subsubsub">
</span><span class="cx">         <li><a href="ms-sites.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Blog'); ?></strong></a> | </li>
</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">         <?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 "editblog":
</span><span class="cx">                 $blog_prefix = $wpdb->get_blog_prefix( $id );
</span><span class="lines">@@ -277,7 +277,7 @@
</span><span class="cx">                                                                 <select name="new_role" id="new_role">
</span><span class="cx">                                                                 <?php
</span><span class="cx">                                                                 reset( $editblog_roles );
</span><del>-                                                                foreach( $editblog_roles as $role => $role_assoc ){
</del><ins>+                                                                foreach ( $editblog_roles as $role => $role_assoc ){
</ins><span class="cx">                                                                         $name = translate_with_context($role_assoc['name']);
</span><span class="cx">                                                                         $selected = ( $role == $editblog_default_role ) ? 'selected="selected"' : '';
</span><span class="cx">                                                                         echo "<option {$selected} value=\"" . esc_attr($role) . "\">{$name}</option>";
</span><span class="lines">@@ -373,7 +373,7 @@
</span><span class="cx">
</span><span class="cx">                 <form action="ms-sites.php" method="get" id="ms-search">
</span><span class="cx">                         <input type="hidden" name="action" value="blogs" />
</span><del>-                        <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s, 1 ) ); ?>" size="17" />
</del><ins>+                        <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s ) ); ?>" size="17" />
</ins><span class="cx">                         <input type="submit" class="button" name="blog_name" value="<?php esc_attr_e('Search blogs by name') ?>" />
</span><span class="cx">                         <input type="submit" class="button" name="blog_id" value="<?php esc_attr_e('by blog ID') ?>" />
</span><span class="cx">                         <input type="submit" class="button" name="blog_ip" value="<?php esc_attr_e('by IP address') ?>" />
</span><span class="lines">@@ -442,10 +442,10 @@
</span><span class="cx">                         </thead>
</span><span class="cx">                         <tbody id="the-list">
</span><span class="cx">                         <?php
</span><del>-                        if ($blog_list) {
</del><ins>+                        if ( $blog_list ) {
</ins><span class="cx">                                 $bgcolor = $class = '';
</span><span class="cx">                                 $status_list = array( "archived" => "#fee", "spam" => "#faa", "deleted" => "#f55" );
</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 "<tr $bgcolour class='$class'>";
</span><span class="cx">
</span><span class="cx">                                         $blogname = ( is_subdomain_install() ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];
</span><del>-                                        foreach( $posts_columns as $column_name=>$column_display_name ) {
</del><ins>+                                        foreach ( $posts_columns as $column_name=>$column_display_name ) {
</ins><span class="cx">                                                 switch($column_name) {
</span><span class="cx">                                                         case 'id': ?>
</span><span class="cx">                                                                 <th scope="row" class="check-column">
</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">         <h2><?php _e( $current_site->site_name ); ?> <?php _e("Users"); ?></h2>
</span><span class="cx">         <form action="ms-users.php" method="get" class="search-form">
</span><span class="cx">                 <p class="search-box">
</span><del>-                <input type="text" name="s" value="<?php if (isset($_GET['s'])) esc_attr( stripslashes( $s ) ); ?>" class="search-input" id="user-search-input" />
</del><ins>+                <input type="text" name="s" value="<?php if ( isset($_GET['s']) ) esc_attr( stripslashes( $s ) ); ?>" class="search-input" id="user-search-input" />
</ins><span class="cx">                 <input type="submit" id="post-query-submit" value="<?php esc_attr_e('Search Users') ?>" class="button" />
</span><span class="cx">                 </p>
</span><span class="cx">         </form>
</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 ) && count( $blogs ) > 0 ) {
</span><del>-                        foreach( (array) $blogs as $blog_id => $blog ) {
</del><ins>+                        foreach ( (array) $blogs as $blog_id => $blog ) {
</ins><span class="cx">                                 if ( $blog->site_id != $wpdb->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 ) && 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->get_results( "SELECT meta_key FROM {$wpdb->sitemeta} WHERE meta_key LIKE 'rss\_%\_ts' AND meta_value < unix_timestamp( date_sub( NOW(), interval 7200 second ) )" );
</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->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s", $row->meta_key ) );
</span><span class="cx">                         $wpdb->query( $wpdb->prepare( "DELETE FROM {$wpdb->sitemeta} WHERE meta_key = %s", str_replace( '_ts', '', $row->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 ) && isset( $current_blog ) )
</del><ins>+if ( isset( $current_site ) && 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->site_name = wp_cache_get( $current_site->id . ':current_site_name', "site-options" );
</span><span class="cx">         if ( !$current_site->site_name ) {
</span><span class="cx">                 $current_site->site_name = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = %d AND meta_key = 'site_name'", $current_site->id ) );
</span><del>-                if( $current_site->site_name == null )
</del><ins>+                if ( $current_site->site_name == null )
</ins><span class="cx">                         $current_site->site_name = ucfirst( $current_site->domain );
</span><span class="cx">                 wp_cache_set( $current_site->id . ':current_site_name', $current_site->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' ) && defined( 'PATH_CURRENT_SITE' ) ) {
</del><ins>+        if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {
</ins><span class="cx">                 $current_site->id = (defined( 'SITE_ID_CURRENT_SITE' ) ? constant('SITE_ID_CURRENT_SITE') : 1);
</span><span class="cx">                 $current_site->domain = DOMAIN_CURRENT_SITE;
</span><span class="cx">                 $current_site->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->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( "current_site", "site-options" );
</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->suppress_errors();
</span><span class="cx">         $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // 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->path;
</span><span class="cx">                 $current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" );
</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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path='/'", $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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path='/'", $sitedomain) );
</span><del>-                if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
-                        if( count( $sites ) == 1 ) {
</del><ins>+                if ( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
+                        if ( count( $sites ) == 1 ) {
</ins><span class="cx">                                 $current_site = $sites[0];
</span><span class="cx">                                 die( "That blog does not exist. Please try <a href='http://{$current_site->domain}{$current_site->path}'>http://{$current_site->domain}{$current_site->path}</a>" );
</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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path = %s", $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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE domain = %s AND path='/'", $domain) );
</span><del>-                if( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
-                        if( count( $sites ) == 1 ) {
</del><ins>+                if ( $current_site == null && defined( "WP_INSTALLING" ) == false ) {
+                        if ( count( $sites ) == 1 ) {
</ins><span class="cx">                                 $current_site = $sites[0];
</span><span class="cx">                                 die( "That blog does not exist. Please try <a href='http://{$current_site->domain}{$current_site->path}'>http://{$current_site->domain}{$current_site->path}</a>" );
</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->blog_id ) )
</del><ins>+if ( !isset( $current_site->blog_id ) )
</ins><span class="cx">         $current_site->blog_id = $wpdb->get_var( "SELECT blog_id FROM {$wpdb->blogs} WHERE domain='{$current_site->domain}' AND path='{$current_site->path}'" );
</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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE domain = %s", $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 && $current_blog->site_id != $current_site->id ) {
</del><ins>+        if ( $current_blog != null && $current_blog->site_id != $current_site->id )
</ins><span class="cx">                 $current_site = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->site WHERE id = %d", $current_blog->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( " ".$blogname, '?' ) )
</del><ins>+        if ( strpos( " ".$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 != '' && !in_array( $blogname, $reserved_blognames ) && !is_file( $blogname ) ) {
</del><ins>+        if ( $blogname != '' && !in_array( $blogname, $reserved_blognames ) && !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->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $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( "WP_INSTALLING" ) == false && is_subdomain_install() && !is_object( $current_blog ) ) {
-        if( defined( 'NOBLOGREDIRECT' ) ) {
</del><ins>+if ( defined( "WP_INSTALLING" ) == false && is_subdomain_install() && !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 = "http://" . $current_site->domain . $current_site->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( "WP_INSTALLING" ) == false ) {
-        if( $current_site && $current_blog == null ) {
-                if( $current_site->domain != $_SERVER[ 'HTTP_HOST' ] ) {
</del><ins>+if ( defined( "WP_INSTALLING" ) == false ) {
+        if ( $current_site && $current_blog == null ) {
+                if ( $current_site->domain != $_SERVER[ 'HTTP_HOST' ] ) {
</ins><span class="cx">                         header( "Location: http://" . $current_site->domain . $current_site->path );
</span><span class="cx">                         exit;
</span><span class="cx">                 }
</span><span class="cx">                 $current_blog = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->blogs WHERE domain = %s AND path = %s", $current_site->domain, $current_site->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->blog_id;
</span><span class="cx"> $public = $current_blog->public;
</span><span class="cx">
</span><del>-if( $current_blog->site_id == 0 || $current_blog->site_id == '' )
</del><ins>+if ( $current_blog->site_id == 0 || $current_blog->site_id == '' )
</ins><span class="cx">         $current_blog->site_id = 1;
</span><span class="cx"> $site_id = $current_blog->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->get_var( "SELECT blog_id FROM $wpdb->blogs LIMIT 0,1" );
-        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 "main" blog.
-         $blog_id = 1;
-        }
-        $current_blog->blog_id = $blog_id;
</del><ins>+                $blog_id = $wpdb->get_var( "SELECT blog_id FROM $wpdb->blogs LIMIT 0,1" );
+                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 "main" blog.
+                 $blog_id = 1;
+                }
+                $current_blog->blog_id = $blog_id;
</ins><span class="cx"> } else {
</span><del>-        $check = $wpdb->get_results( "SELECT * FROM $wpdb->site" );
-        if( $check == false ) {
-         $msg = ': DB Tables Missing';
-        } else {
-         $msg = '';
-        }
-        die( "No Blog by that name on this system." . $msg );
</del><ins>+                $check = $wpdb->get_results( "SELECT * FROM $wpdb->site" );
+                if ( $check == false )
+                 $msg = ': DB Tables Missing';
+                else
+                 $msg = '';
+                die( "No Blog by that name on this system." . $msg );
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $wpdb->suppress_errors( false );
</span><span class="cx">
</span><del>-if( '0' == $current_blog->public ) {
</del><ins>+if ( '0' == $current_blog->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( "WP_INSTALLING" ) == false ) {
</del><ins>+        if ( defined( "WP_INSTALLING" ) == false ) {
</ins><span class="cx">                 $check = $wpdb->get_results( "SELECT * FROM $wpdb->site" );
</span><span class="cx">                 $msg = "If your blog does not display, please contact the owner of this site.<br /><br />If you are the owner of this site please check that MySQL is running properly and all tables are error free.<br /><br />";
</span><del>-                if( $check == false ) {
</del><ins>+                if ( $check == false ) {
</ins><span class="cx">                         $msg .= "<strong>Database Tables Missing.</strong><br />Database tables are missing. This means that MySQL is either not running, WPMU was not installed properly, or someone deleted {$wpdb->site}. You really <em>should</em> look at your database now.<br />";
</span><span class="cx">                 } else {
</span><span class="cx">                         $msg .= '<strong>Could Not Find Blog!</strong><br />';
</span><span class="lines">@@ -247,7 +244,7 @@
</span><span class="cx">                         <li> $wpdb->sitecategories </li>
</span><span class="cx">                         </ul>";
</span><span class="cx">                 $msg .= "If you suspect a problem please report it to the support forums but you must include the information asked for in the <a href='http://codex.wordpress.org/Debugging_WPMU'>WPMU bug reporting guidelines</a>!<br /><br />";
</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: "';
</span><span class="cx">                         $info = file( 'release-info.txt' );
</span><span class="cx">                         $msg .= $info[ 4 ] . '"';
</span></span></pre>
</div>
</div>
</body>
</html>