<!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>[12632] trunk: Strip trailing whites from ms files.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12632">12632</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-07 04:27:46 +0000 (Thu, 07 Jan 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Strip trailing whites from ms files. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesmsphp">trunk/wp-admin/includes/ms.php</a></li>
<li><a href="#trunkwpadminmsadminphp">trunk/wp-admin/ms-admin.php</a></li>
<li><a href="#trunkwpadminmseditphp">trunk/wp-admin/ms-edit.php</a></li>
<li><a href="#trunkwpadminmsoptionsphp">trunk/wp-admin/ms-options.php</a></li>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpadminmsupgradesitephp">trunk/wp-admin/ms-upgrade-site.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="trunkwpadminincludesmsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/ms.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/includes/ms.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx">         update_blog_status( $blog_id, 'deleted', 1 );
</span><span class="cx">
</span><span class="cx">         if ( $drop ) {
</span><del>-                $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A);
-                $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables );
</del><ins>+                $drop_tables = $wpdb->get_results("show tables LIKE '". $wpdb->base_prefix . $blog_id . "\_%'", ARRAY_A);
+                $drop_tables = apply_filters( 'wpmu_drop_tables', $drop_tables );
</ins><span class="cx">
</span><span class="cx">                 reset( $drop_tables );
</span><span class="cx">                 foreach ( (array) $drop_tables as $drop_table) {
</span><span class="lines">@@ -219,10 +219,10 @@
</span><span class="cx">                 "newemail" => $value
</span><span class="cx">         );
</span><span class="cx">         update_option( 'adminhash', $new_admin_email );
</span><del>-        
</del><ins>+
</ins><span class="cx">         $content = apply_filters( 'new_admin_email_content', __("Dear user,
</span><span class="cx">
</span><del>-You recently requested to have the administration email address on
</del><ins>+You recently requested to have the administration email address on
</ins><span class="cx"> your blog changed.
</span><span class="cx"> If this is correct, please click on the following link to change it:
</span><span class="cx"> ###ADMIN_URL###
</span><span class="lines">@@ -235,12 +235,12 @@
</span><span class="cx"> Regards,
</span><span class="cx"> All at ###SITENAME###
</span><span class="cx"> ###SITEURL###"), $new_admin_email );
</span><del>-        
</del><ins>+
</ins><span class="cx">         $content = str_replace('###ADMIN_URL###', clean_url(get_option( "siteurl" ).'/wp-admin/options.php?adminhash='.$hash), $content);
</span><span class="cx">         $content = str_replace('###EMAIL###', $value, $content);
</span><span class="cx">         $content = str_replace('###SITENAME###', get_site_option( 'site_name' ), $content);
</span><span class="cx">         $content = str_replace('###SITEURL###', 'http://' . $current_site->domain . $current_site->path, $content);
</span><del>-        
</del><ins>+
</ins><span class="cx">         wp_mail( $value, sprintf(__('[%s] New Admin Email Address'), get_option('blogname')), $content );
</span><span class="cx"> }
</span><span class="cx"> add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2);
</span><span class="lines">@@ -354,7 +354,7 @@
</span><span class="cx">
</span><span class="cx"> function get_space_allowed() {
</span><span class="cx">         $spaceAllowed = get_option("blog_upload_space");
</span><del>-        if( $spaceAllowed == false )
</del><ins>+        if( $spaceAllowed == false )
</ins><span class="cx">                 $spaceAllowed = get_site_option("blog_upload_space");
</span><span class="cx">         if( empty($spaceAllowed) || !is_numeric($spaceAllowed) )
</span><span class="cx">                 $spaceAllowed = 50;
</span><span class="lines">@@ -376,12 +376,12 @@
</span><span class="cx">                 $space .= __('MB');
</span><span class="cx">         }
</span><span class="cx">         ?>
</span><del>-        <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong>
</del><ins>+        <strong><?php printf(__('Used: %1s%% of %2s'), number_format($percentused), $space );?></strong>
</ins><span class="cx">         <?php
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Display File upload quota on dashboard
</span><del>-function dashboard_quota() {        
</del><ins>+function dashboard_quota() {
</ins><span class="cx">         if ( get_site_option( 'upload_space_check_disabled' ) ) {
</span><span class="cx">                 return true;
</span><span class="cx">         }
</span><span class="lines">@@ -412,10 +412,10 @@
</span><span class="cx">
</span><span class="cx"> // Edit blog upload space setting on Edit Blog page
</span><span class="cx"> function upload_space_setting( $id ) {
</span><del>-        $quota = get_blog_option($id, "blog_upload_space");
</del><ins>+        $quota = get_blog_option($id, "blog_upload_space");
</ins><span class="cx">         if( !$quota )
</span><span class="cx">                 $quota = '';
</span><del>-        
</del><ins>+
</ins><span class="cx">         ?>
</span><span class="cx">         <tr>
</span><span class="cx">                 <th><?php _e('Blog Upload Space Quota'); ?></th>
</span><span class="lines">@@ -432,9 +432,9 @@
</span><span class="cx">
</span><span class="cx">         if( $refresh == 1 )
</span><span class="cx">                 refresh_user_details($id);
</span><del>-        
</del><ins>+
</ins><span class="cx">         if( $pref == 'spam' ) {
</span><del>-                if( $value == 1 )
</del><ins>+                if( $value == 1 )
</ins><span class="cx">                         do_action( "make_spam_user", $id );
</span><span class="cx">                 else
</span><span class="cx">                         do_action( "make_ham_user", $id );
</span><span class="lines">@@ -445,7 +445,7 @@
</span><span class="cx">
</span><span class="cx"> function refresh_user_details($id) {
</span><span class="cx">         $id = (int) $id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( !$user = get_userdata( $id ) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><span class="lines">@@ -464,8 +464,8 @@
</span><span class="cx">         $spaceAllowed = get_space_allowed();
</span><span class="cx">
</span><span class="cx">         $dirName = trailingslashit( BLOGUPLOADDIR );
</span><del>-        if (!(is_dir($dirName) && is_readable($dirName)))
-                return;
</del><ins>+        if (!(is_dir($dirName) && is_readable($dirName)))
+                return;
</ins><span class="cx">
</span><span class="cx">         $dir = dir($dirName);
</span><span class="cx">         $size = 0;
</span><span class="lines">@@ -512,7 +512,7 @@
</span><span class="cx">         $c = 0;
</span><span class="cx">         if ( isset( $_GET[ 'c' ] ) )
</span><span class="cx">                 $c = (int)$_GET[ 'c' ];
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( $c >= 5 ) {
</span><span class="cx">                 wp_die( __( "You don&#8217;t have permission to view this blog. Please contact the system administrator." ) );
</span><span class="cx">         }
</span><span class="lines">@@ -521,13 +521,13 @@
</span><span class="cx">         $blog = get_active_blog_for_user( $current_user->ID );
</span><span class="cx">         $dashboard_blog = get_dashboard_blog();
</span><span class="cx">         if( is_object( $blog ) ) {
</span><del>-                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</del><ins>+                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</ins><span class="cx">                 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
</span><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        /*
-         If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,
</del><ins>+        /*
+         If the user is a member of only 1 blog and the user's primary_blog isn't set to that blog,
</ins><span class="cx">          then update the primary_blog record to match the user's blog
</span><span class="cx">          */
</span><span class="cx">         $blogs = get_blogs_of_user( $current_user->ID );
</span><span class="lines">@@ -540,7 +540,7 @@
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">                 $blog = get_blog_details( get_usermeta( $current_user->ID , 'primary_blog' ) );
</span><del>-                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</del><ins>+                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</ins><span class="cx">                 wp_redirect( $protocol . $blog->domain . $blog->path . 'wp-admin/?c=' . $c ); // redirect and count to 5, "just in case"
</span><span class="cx">                 exit;
</span><span class="cx">         }
</span><span class="lines">@@ -558,7 +558,7 @@
</span><span class="cx">         } else {
</span><span class="cx">                 $writing = array( 'ping_sites', 'mailserver_login', 'mailserver_pass', 'default_email_category', 'mailserver_port', 'mailserver_url' );
</span><span class="cx">         }
</span><del>-        $removed = array(
</del><ins>+        $removed = array(
</ins><span class="cx">                 'general' => array( 'siteurl', 'home', 'admin_email', 'users_can_register', 'default_role' ),
</span><span class="cx">                 'reading' => array( 'gzipcompression' ),
</span><span class="cx">                 'writing' => $writing,
</span><span class="lines">@@ -584,12 +584,12 @@
</span><span class="cx"> // See "import_allow_fetch_attachments" and "import_attachment_size_limit" filters too.
</span><span class="cx">
</span><span class="cx"> function mu_dropdown_languages( $lang_files = array(), $current = '' ) {
</span><del>-        $flag = false;        
</del><ins>+        $flag = false;
</ins><span class="cx">         $output = array();
</span><del>-                                        
</del><ins>+
</ins><span class="cx">         foreach ( (array) $lang_files as $val ) {
</span><span class="cx">                 $code_lang = basename( $val, '.mo' );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( $code_lang == 'en_US' ) { // American English
</span><span class="cx">                         $flag = true;
</span><span class="cx">                         $ae = __('American English');
</span><span class="lines">@@ -602,18 +602,18 @@
</span><span class="cx">                         $translated = format_code_lang($code_lang);
</span><span class="cx">                         $output[$translated] = '<option value="'.$code_lang.'"'.(($current == $code_lang) ? ' selected="selected"' : '').'> '.$translated.'</option>';
</span><span class="cx">                 }
</span><del>-                
-        }                                                
-        
</del><ins>+
+        }
+
</ins><span class="cx">         if ( $flag === false ) { // WordPress english
</span><span class="cx">                 $output[] = '<option value=""'.((empty($current)) ? ' selected="selected"' : '').'>'.__('English')."</option>";
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Order by name
</span><span class="cx">         uksort($output, 'strnatcasecmp');
</span><del>-        
-        $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current);        
-        echo implode("\n\t", $output);        
</del><ins>+
+        $output = apply_filters('mu_dropdown_languages', $output, $lang_files, $current);
+        echo implode("\n\t", $output);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Only show "Media" upload icon
</span><span class="lines">@@ -762,10 +762,10 @@
</span><span class="cx"> function activate_sitewide_plugin() {
</span><span class="cx">         if ( !isset( $_GET['sitewide'] ) )
</span><span class="cx">                 return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">         /* Add the plugin to the list of sitewide active plugins */
</span><span class="cx">         $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* Add the activated plugin to the list */
</span><span class="cx">         $active_sitewide_plugins[ $_GET['plugin'] ] = time();
</span><span class="cx">
</span><span class="lines">@@ -775,7 +775,7 @@
</span><span class="cx">
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><del>-add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' );
</del><ins>+add_action( 'activate_' . $_GET['plugin'], 'activate_sitewide_plugin' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * deactivate_sitewide_plugin()
</span><span class="lines">@@ -785,7 +785,7 @@
</span><span class="cx"> function deactivate_sitewide_plugin( $plugin = false ) {
</span><span class="cx">         if ( !$plugin )
</span><span class="cx">                 $plugin = $_GET['plugin'];
</span><del>-                
</del><ins>+
</ins><span class="cx">         /* Get the active sitewide plugins */
</span><span class="cx">         $active_sitewide_plugins = (array) maybe_unserialize( get_site_option( 'active_sitewide_plugins' ) );
</span><span class="cx">
</span><span class="lines">@@ -797,11 +797,11 @@
</span><span class="cx">
</span><span class="cx">         if ( !update_site_option( 'active_sitewide_plugins', $active_sitewide_plugins ) )
</span><span class="cx">                 wp_redirect( 'plugins.php?error=true' );
</span><del>-        
</del><ins>+
</ins><span class="cx">         return true;
</span><span class="cx"> }
</span><del>-add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' );
-add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' );
</del><ins>+add_action( 'deactivate_' . $_GET['plugin'], 'deactivate_sitewide_plugin' );
+add_action( 'deactivate_invalid_plugin', 'deactivate_sitewide_plugin' );
</ins><span class="cx">
</span><span class="cx"> /**
</span><span class="cx"> * add_sitewide_activate_row()
</span><span class="lines">@@ -811,13 +811,13 @@
</span><span class="cx"> function add_sitewide_activate_row( $file, $plugin_data, $context ) {
</span><span class="cx">         if ( !is_site_admin() )
</span><span class="cx">                 return false;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( 'sitewide-active' == $context )
</span><span class="cx">                 return false;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( is_plugin_active( $file ) )
</span><span class="cx">                 return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">         echo '<tr><td colspan="5" style="background: #f5f5f5; text-align: right;">';
</span><span class="cx">
</span><span class="cx">         echo '<a href="' . wp_nonce_url( admin_url( 'plugins.php?action=activate&amp;sitewide=1&amp;plugin=' . $file ), 'activate-plugin_' . $file ) . '" title="' . __( 'Activate this plugin for all blogs across the entire network' ) . '">&uarr; ' . sprintf( __( 'Activate %s Site Wide' ), strip_tags( $plugin_data["Title"] ) ) . '</a>';
</span><span class="lines">@@ -834,13 +834,13 @@
</span><span class="cx"> function is_wpmu_sitewide_plugin( $file ) {
</span><span class="cx">         /* Open the plugin file for reading to check if this is a ms-plugin. */
</span><span class="cx">         $fp = @fopen( WP_PLUGIN_DIR . '/' . $file, 'r' );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* Pull only the first 8kiB of the file in. */
</span><span class="cx">         $plugin_data = @fread( $fp, 8192 );
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* PHP will close file handle, but we are good citizens. */
</span><span class="cx">         @fclose($fp);
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( preg_match( '|Site Wide Only:(.*)true$|mi', $plugin_data ) )
</span><span class="cx">                 return true;
</span><span class="cx">
</span><span class="lines">@@ -858,14 +858,14 @@
</span><span class="cx">
</span><span class="cx">         if ( !is_site_admin() )
</span><span class="cx">                 return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">         $active_sitewide_plugins = maybe_unserialize( get_site_option( 'active_sitewide_plugins') );
</span><span class="cx">         $context = 'sitewide-active';
</span><span class="cx">
</span><del>-        if ( $active_sitewide_plugins ) {
</del><ins>+        if ( $active_sitewide_plugins ) {
</ins><span class="cx"> ?>
</span><span class="cx">                 <h3><?php _e( 'Currently Active Site Wide Plugins' ) ?></h3>
</span><del>-        
</del><ins>+
</ins><span class="cx">                 <p><?php _e( 'Plugins that appear in the list below are activate for all blogs across this installation.' ) ?></p>
</span><span class="cx">
</span><span class="cx">                 <table class="widefat" cellspacing="0" id="<?php echo $context ?>-plugins-table">
</span><span class="lines">@@ -898,7 +898,7 @@
</span><span class="cx">                                 $action_links = apply_filters( "plugin_action_links_$plugin_file", $action_links, $plugin_file, $plugin_data, $context );
</span><span class="cx">
</span><span class="cx">                                 $plugin_data = $all_plugins[$plugin_file];
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 echo "
</span><span class="cx">                         <tr class='$context' style='background: #eef2ff;'>
</span><span class="cx">                                 <th scope='row' class='check-column'>&nbsp;</th>
</span><span class="lines">@@ -931,16 +931,16 @@
</span><span class="cx">                                 echo implode(' | ', $plugin_meta);
</span><span class="cx">                                 echo "</td>
</span><span class="cx">                         </tr>\n";
</span><del>-                        
</del><ins>+
</ins><span class="cx">                                 do_action( 'after_plugin_row', $plugin_file, $plugin_data, $context );
</span><span class="cx">                                 do_action( "after_plugin_row_$plugin_file", $plugin_file, $plugin_data, $context );
</span><span class="cx">                         }
</span><span class="cx">                 ?>
</span><span class="cx">                         </tbody>
</span><span class="cx">                 </table>
</span><del>-                
</del><ins>+
</ins><span class="cx">                 <p><?php _e( 'Plugins that are enabled site wide can only be disabled by a site administrator.' ) ?></p>
</span><del>-                
</del><ins>+
</ins><span class="cx"> <?php
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -959,14 +959,14 @@
</span><span class="cx">                 unset( $inactive_plugins[ $sitewide_plugin ] );
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        /* Now unset any sitewide only plugins if the user is not a site admin */        
</del><ins>+        /* Now unset any sitewide only plugins if the user is not a site admin */
</ins><span class="cx">         if ( !is_site_admin() ) {
</span><span class="cx">                 foreach ( $inactive_plugins as $plugin_name => $activated_time ) {
</span><span class="cx">                         if ( is_wpmu_sitewide_plugin( $plugin_name ) )
</span><span class="cx">                                 unset( $inactive_plugins[ $plugin_name ] );
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         return $inactive_plugins;
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'all_plugins', 'sitewide_filter_inactive_plugins_list' );
</span><span class="lines">@@ -983,7 +983,7 @@
</span><span class="cx">         foreach ( $active_sitewide_plugins as $sitewide_plugin => $activated_time ) {
</span><span class="cx">                 unset( $active_plugins[ $sitewide_plugin ] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         return $active_plugins;
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'all_plugins', 'sitewide_filter_active_plugins_list' );
</span><span class="lines">@@ -996,12 +996,12 @@
</span><span class="cx"> */
</span><span class="cx"> function check_is_wpmu_plugin_on_activate() {
</span><span class="cx">         /***
</span><del>-         * On plugin activation on a blog level, check to see if this is actually a
</del><ins>+         * On plugin activation on a blog level, check to see if this is actually a
</ins><span class="cx">          * site wide MU plugin. If so, deactivate and activate it site wide.
</span><span class="cx">          */
</span><span class="cx">         if ( is_wpmu_sitewide_plugin( $_GET['plugin'] ) || isset( $_GET['sitewide'] ) ) {
</span><span class="cx">                 deactivate_plugins( $_GET['plugin'], true );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 /* Silently activate because the activate_* hook has already run. */
</span><span class="cx">                 if ( is_site_admin() ) {
</span><span class="cx">                         $_GET['sitewide'] = true;
</span><span class="lines">@@ -1022,7 +1022,7 @@
</span><span class="cx">
</span><span class="cx">                                 if ( is_site_admin() )
</span><span class="cx">                                         activate_sitewide_plugin( $plugin );
</span><del>-                        }                        
</del><ins>+                        }
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -1050,10 +1050,10 @@
</span><span class="cx">                         $found = false;
</span><span class="cx">                         ?>
</span><span class="cx">                         <select name="primary_blog">
</span><del>-                                <?php foreach( (array) $all_blogs as $blog ) {
</del><ins>+                                <?php foreach( (array) $all_blogs as $blog ) {
</ins><span class="cx">                                         if( $primary_blog == $blog->userblog_id )
</span><span class="cx">                                                 $found = true;
</span><del>-                                        ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php
</del><ins>+                                        ?><option value='<?php echo $blog->userblog_id ?>'<?php if( $primary_blog == $blog->userblog_id ) echo ' selected="selected"' ?>>http://<?php echo $blog->domain.$blog->path ?></option><?php
</ins><span class="cx">                                 } ?>
</span><span class="cx">                         </select>
</span><span class="cx">                         <?php
</span><span class="lines">@@ -1073,7 +1073,7 @@
</span><span class="cx">                 </td>
</span><span class="cx">         </tr>
</span><span class="cx">         </table>
</span><del>-        <?php        
</del><ins>+        <?php
</ins><span class="cx"> }
</span><span class="cx"> add_action ( 'myblogs_allblogs_options', 'choose_primary_blog' );
</span><span class="cx">
</span><span class="lines">@@ -1144,7 +1144,7 @@
</span><span class="cx">         <form id="myblogs" action="" method="post">
</span><span class="cx">         <?php
</span><span class="cx">         do_action( 'myblogs_allblogs_options' );
</span><del>-        ?><table class='widefat'> <?php
</del><ins>+        ?><table class='widefat'> <?php
</ins><span class="cx">         $settings_html = apply_filters( 'myblogs_options', '', 'global' );
</span><span class="cx">         if ( $settings_html != '' ) {
</span><span class="cx">                 echo "<tr><td valign='top'><h3>" . __( 'Global Settings' ) . "</h3></td><td>";
</span><span class="lines">@@ -1165,7 +1165,7 @@
</span><span class="cx">                 $rows[] = array_slice( $blogs, $split, $cols );
</span><span class="cx">                 $split = $split + $cols;
</span><span class="cx">         }
</span><del>-
</del><ins>+
</ins><span class="cx">         foreach( $rows as $row ) {
</span><span class="cx">                 $c = $c == "alternate" ? "" : "alternate";
</span><span class="cx">                 echo "<tr class='$c'>";
</span><span class="lines">@@ -1216,8 +1216,8 @@
</span><span class="cx">                 while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {
</span><span class="cx">                         foreach( $rows as $row ) {
</span><span class="cx">                                 $value = $row->meta_value;
</span><del>-                                if ( !@unserialize( $value ) )
-                                        $value = stripslashes( $value );
</del><ins>+                                if ( !@unserialize( $value ) )
+                                        $value = stripslashes( $value );
</ins><span class="cx">                                 if ( $value !== $row->meta_value ) {
</span><span class="cx">                                         update_site_option( $row->meta_key, $value );
</span><span class="cx">                                 }
</span><span class="lines">@@ -1230,8 +1230,8 @@
</span><span class="cx">         while( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $options_table ORDER BY option_id LIMIT $start, 20" ) ) {
</span><span class="cx">                 foreach( $rows as $row ) {
</span><span class="cx">                         $value = $row->option_value;
</span><del>-                        if ( !@unserialize( $value ) )
-                                $value = stripslashes( $value );
</del><ins>+                        if ( !@unserialize( $value ) )
+                                $value = stripslashes( $value );
</ins><span class="cx">                         if ( $value !== $row->option_value ) {
</span><span class="cx">                                 update_blog_option( $blog_id, $row->option_name, $value );
</span><span class="cx">                         }
</span></span></pre></div>
<a id="trunkwpadminmsadminphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-admin.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-admin.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-admin.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -30,7 +30,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 wp_specialchars( $title ); ?></h2>
</ins><span class="cx">
</span><span class="cx">         <ul class="subsubsub">
</span><span class="cx">         <li><a href="ms-blogs.php#form-add-blog" class="rbutton"><strong><?php _e('Create a New Blog'); ?></strong></a> | </li>
</span><span class="lines">@@ -44,9 +44,9 @@
</span><span class="cx">         <form name="searchform" action="ms-users.php" method="get">
</span><span class="cx">                 <p>
</span><span class="cx">                         <input type="hidden" name="action" value="users" />
</span><del>-                        <input type="text" name="s" value="" size="17" />
</del><ins>+                        <input type="text" name="s" value="" size="17" />
</ins><span class="cx">                         <input class="button" type="submit" name="submit" value="<?php esc_attr_e("Search Users"); ?>" />
</span><del>-                </p>
</del><ins>+                </p>
</ins><span class="cx">         </form>
</span><span class="cx">
</span><span class="cx">         <form name="searchform" action="ms-blogs.php" method="get">
</span></span></pre></div>
<a id="trunkwpadminmseditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-edit.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-edit.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-edit.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -10,10 +10,10 @@
</span><span class="cx">
</span><span class="cx"> do_action('wpmuadminedit', '');
</span><span class="cx">
</span><del>-if( isset($_GET[ 'id' ]) ) {
-        $id = intval( $_GET[ 'id' ] );
-} elseif( isset($_POST[ 'id' ]) ) {
-        $id = intval( $_POST[ 'id' ] );
</del><ins>+if( isset($_GET[ 'id' ]) ) {
+        $id = intval( $_GET[ 'id' ] );
+} elseif( isset($_POST[ 'id' ]) ) {
+        $id = intval( $_POST[ 'id' ] );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if( isset( $_POST['ref'] ) == false && !empty($_SERVER['HTTP_REFERER']) ) {
</span><span class="lines">@@ -143,8 +143,8 @@
</span><span class="cx">
</span><span class="cx">                 if ( empty($domain) || empty($email))
</span><span class="cx">                         wp_die( __('Missing blog address or email address.') );
</span><del>-                if( !is_email( $email ) )
-                        wp_die( __('Invalid email address') );
</del><ins>+                if( !is_email( $email ) )
+                        wp_die( __('Invalid email address') );
</ins><span class="cx">
</span><span class="cx">                 if( constant( 'VHOST' ) == 'yes' ) {
</span><span class="cx">                         $newdomain = $domain.".".$current_site->domain;
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                         if( get_option( 'home' ) != 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] )
</span><span class="cx">                                 update_option( 'home', 'http://' . $_POST['blog']['domain'] . $_POST['blog']['path'] );
</span><span class="cx">                 }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $wp_rewrite->flush_rules();
</span><span class="cx">
</span><span class="cx">                 // update blogs table
</span><span class="lines">@@ -317,11 +317,11 @@
</span><span class="cx">                                 } elseif ( isset($_POST['allblog_spam']) ) {
</span><span class="cx">                                         $blogfunction = 'all_spam';
</span><span class="cx">                                         update_blog_status( $val, "spam", '1', 0 );
</span><del>-                                        set_time_limit(60);
</del><ins>+                                        set_time_limit(60);
</ins><span class="cx">                                 } elseif ( isset($_POST['allblog_notspam']) ) {
</span><span class="cx">                                         $blogfunction = 'all_notspam';
</span><span class="cx">                                         update_blog_status( $val, "spam", '0', 0 );
</span><del>-                                        set_time_limit(60);
</del><ins>+                                        set_time_limit(60);
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="lines">@@ -431,7 +431,7 @@
</span><span class="cx">                                         <input type='hidden' name='ref' value='<?php echo $referrer; ?>' />
</span><span class="cx">                                         <?php wp_nonce_field( $_GET['action2'] ) ?>
</span><span class="cx">                                         <p><?php echo wp_specialchars( stripslashes($_GET['msg']) ); ?></p>
</span><del>-                                        <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p>                                                
</del><ins>+                                        <p class="submit"><input class="button" type='submit' value='<?php _e("Confirm"); ?>' /></p>
</ins><span class="cx">                                 </form>
</span><span class="cx">                         </body>
</span><span class="cx">                 </html>
</span></span></pre></div>
<a id="trunkwpadminmsoptionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-options.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-options.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-options.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -280,7 +280,7 @@
</span><span class="cx">                         <a name='menu'></a>
</span><span class="cx">                         <?php
</span><span class="cx">                         $menu_perms = get_site_option( "menu_items" );
</span><del>-                        $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );                        
</del><ins>+                        $menu_items = apply_filters( 'mu_menu_items', array('plugins' => __('Plugins')) );
</ins><span class="cx">                         foreach ( (array) $menu_items as $key => $val ) {
</span><span class="cx">                                 echo "<tr><th scope='row'>" . wp_specialchars($val) . "</th><td><input type='checkbox' name='menu_items[" . $key . "]' value='1'" . (( $menu_perms[$key] == '1' ) ? ' checked="checked"' : '') . " /></td></tr>";
</span><span class="cx">                         }
</span></span></pre></div>
<a id="trunkwpadminmssitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-sites.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-sites.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -81,68 +81,68 @@
</span><span class="cx">                 <h2><?php _e('Edit Blog'); ?> - <a href='http://<?php echo $details['domain'].$details['path']; ?>'>http://<?php echo $details['domain'].$details['path']; ?></a></h2>
</span><span class="cx">                 <form method="post" action="ms-edit.php?action=updateblog">
</span><span class="cx">                         <?php wp_nonce_field('editblog'); ?>
</span><del>-                        <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
</del><ins>+                        <input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
</ins><span class="cx">                         <div class='metabox-holder' style='width:49%;float:left;'>
</span><span class="cx">                         <div id="blogedit_bloginfo" class="postbox " >
</span><span class="cx">                         <h3 class='hndle'><span><?php _e('Blog info (wp_blogs)'); ?></span></h3>
</span><span class="cx">                         <div class="inside">
</span><span class="cx">                                 <table class="form-table">
</span><span class="cx">                                                         <tr class="form-field form-required">
</span><del>-                                                                <th scope="row"><?php _e('Domain') ?></th>
</del><ins>+                                                                <th scope="row"><?php _e('Domain') ?></th>
</ins><span class="cx">                                                                 <td>http://<input name="blog[domain]" type="text" id="domain" value="<?php echo $details['domain'] ?>" size="33" /></td>
</span><del>-                                                        </tr>
</del><ins>+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field form-required">
</span><del>-                                                                <th scope="row"><?php _e('Path') ?></th>
</del><ins>+                                                                <th scope="row"><?php _e('Path') ?></th>
</ins><span class="cx">                                                                 <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr($details['path']) ?>" size="40" style='margin-bottom:5px;' />
</span><span class="cx">                                                                 <br /><input type='checkbox' style='width:20px;' name='update_home_url' value='update' <?php if( get_blog_option( $id, 'siteurl' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) || get_blog_option( $id, 'home' ) == preg_replace('|/+$|', '', 'http://' . $details['domain'] . $details['path']) ) echo 'checked="checked"'; ?> /> <?php _e( "Update 'siteurl' and 'home' as well." ); ?></td>
</span><del>-                                                        </tr>
</del><ins>+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e('Registered') ?></th>
-                                                                <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td>
-                                                        </tr>
</del><ins>+                                                                <th scope="row"><?php _e('Registered') ?></th>
+                                                                <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details['registered']) ?>" size="40" /></td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e('Last Updated') ?></th>
-                                                                <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td>
-                                                        </tr>
</del><ins>+                                                                <th scope="row"><?php _e('Last Updated') ?></th>
+                                                                <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details['last_updated']) ?>" size="40" /></td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e('Public') ?></th>
</del><ins>+                                                                <th scope="row"><?php _e('Public') ?></th>
</ins><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[public]' value='1' <?php if( $details['public'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[public]' value='0' <?php if( $details['public'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</span><del>-                                                                </td>
-                                                        </tr>
</del><ins>+                                                                </td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e( 'Archived' ); ?></th>
</del><ins>+                                                                <th scope="row"><?php _e( 'Archived' ); ?></th>
</ins><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[archived]' value='1' <?php if( $details['archived'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[archived]' value='0' <?php if( $details['archived'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</span><del>-                                                                </td>
-                                                        </tr>
</del><ins>+                                                                </td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e( 'Mature' ); ?></th>
</del><ins>+                                                                <th scope="row"><?php _e( 'Mature' ); ?></th>
</ins><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[mature]' value='1' <?php if( $details['mature'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[mature]' value='0' <?php if( $details['mature'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</span><del>-                                                                </td>
-                                                        </tr>
</del><ins>+                                                                </td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e( 'Spam' ); ?></th>
</del><ins>+                                                                <th scope="row"><?php _e( 'Spam' ); ?></th>
</ins><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[spam]' value='1' <?php if( $details['spam'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[spam]' value='0' <?php if( $details['spam'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</span><del>-                                                                </td>
-                                                        </tr>
</del><ins>+                                                                </td>
+                                                        </tr>
</ins><span class="cx">                                                         <tr class="form-field">
</span><del>-                                                                <th scope="row"><?php _e( 'Deleted' ); ?></th>
</del><ins>+                                                                <th scope="row"><?php _e( 'Deleted' ); ?></th>
</ins><span class="cx">                                                                 <td>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[deleted]' value='1' <?php if( $details['deleted'] == '1' ) echo 'checked="checked"'; ?> /> <?php _e('Yes') ?>
</span><span class="cx">                                                                         <input type='radio' style='width:20px;' name='blog[deleted]' value='0' <?php if( $details['deleted'] == '0' ) echo 'checked="checked"'; ?> /> <?php _e('No') ?>
</span><del>-                                                                </td>
-                                                        </tr>
</del><ins>+                                                                </td>
+                                                        </tr>
</ins><span class="cx">                                                 </table>
</span><span class="cx">                                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="cx">                         </div></div>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <div id="blogedit_blogoptions" class="postbox " >
</span><span class="cx">                         <h3 class='hndle'><span><?php printf( __('Blog options (wp_%s_options)'), $id ); ?></span></h3>
</span><span class="cx">                         <div class="inside">
</span><span class="lines">@@ -165,16 +165,16 @@
</span><span class="cx">                                                                 if ( stristr($val['option_value'], "\r") || stristr($val['option_value'], "\n") || stristr($val['option_value'], "\r\n") ) {
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                         <tr class="form-field">
</span><del>-                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
</del><ins>+                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
</ins><span class="cx">                                                                                 <td><textarea rows="5" cols="40" name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>"<?php echo $disabled ?>><?php echo wp_specialchars( stripslashes( $val['option_value'] ), 1 ) ?></textarea></td>
</span><span class="cx">                                                                         </tr>
</span><span class="cx">                                                                 <?php
</span><span class="cx">                                                                 } else {
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                         <tr class="form-field">
</span><del>-                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
-                                                                                <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td>
-                                                                        </tr>
</del><ins>+                                                                                <th scope="row"><?php echo ucwords( str_replace( "_", " ", $val['option_name'] ) ) ?></th>
+                                                                                <td><input name="option[<?php echo $val['option_name'] ?>]" type="text" id="<?php echo $val['option_name'] ?>" value="<?php echo esc_attr( stripslashes( $val['option_value'] ), 1 ) ?>" size="40" <?php echo $disabled ?> /></td>
+                                                                        </tr>
</ins><span class="cx">                                                                 <?php
</span><span class="cx">                                                                 }
</span><span class="cx">                                                         } // End foreach
</span><span class="lines">@@ -183,7 +183,7 @@
</span><span class="cx">                                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="cx">                         </div></div>
</span><span class="cx">                         </div>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <div class='metabox-holder' style='width:49%;float:right;'>
</span><span class="cx">                         <?php
</span><span class="cx">                                         // Blog Themes
</span><span class="lines">@@ -199,12 +199,12 @@
</span><span class="cx">                                                 if( isset($allowed_themes[$theme_key] ) == false ) {
</span><span class="cx">                                                         $checked = ( isset($blog_allowed_themes[ $theme_key ]) ) ? 'checked="checked"' : '';
</span><span class="cx">                                                         $out .= '<tr class="form-field form-required">
</span><del>-                                                                        <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th>
-                                                                        <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td>
</del><ins>+                                                                        <th title="'.htmlspecialchars( $theme["Description"] ).'" scope="row">'.$key.'</th>
+                                                                        <td><input name="theme['.$theme_key.']" type="checkbox" style="width:20px;" value="on" '.$checked.'/>' . __( 'Active' ) . '</td>
</ins><span class="cx">                                                                 </tr>';
</span><span class="cx">                                                 }
</span><span class="cx">                                         }
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         if ( $out != '' ) {
</span><span class="cx">                         ?>
</span><span class="cx">                         <div id="blogedit_blogthemes" class="postbox">
</span><span class="lines">@@ -217,7 +217,7 @@
</span><span class="cx">                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="cx">                         </div></div>
</span><span class="cx">                         <?php } ?>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <?php
</span><span class="cx">                                         // Blog users
</span><span class="cx">                                         $blogusers = get_users_of_blog( $id );
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx">                                                         if( $val->user_id != $current_user->data->ID ) {
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                 <td>
</span><del>-                                                                        <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php
</del><ins>+                                                                        <select name="role[<?php echo $val->user_id ?>]" id="new_role"><?php
</ins><span class="cx">                                                                                 foreach( $editblog_roles as $role => $role_assoc ){
</span><span class="cx">                                                                                         $name = translate_with_context($role_assoc['name']);
</span><span class="cx">                                                                                         $selected = ( $role == $existing_role ) ? 'selected="selected"' : '';
</span><span class="lines">@@ -260,7 +260,7 @@
</span><span class="cx">                                                 echo "</div></div>";
</span><span class="cx">                                         }
</span><span class="cx">                         ?>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <div id="blogedit_blogadduser" class="postbox">
</span><span class="cx">                         <h3 class='hndle'><span><?php _e('Add a new user'); ?></span></h3>
</span><span class="cx">                         <div class="inside">
</span><span class="lines">@@ -274,7 +274,7 @@
</span><span class="cx">                                                         <th scope="row"><?php _e('Role:') ?></th>
</span><span class="cx">                                                         <td>
</span><span class="cx">                                                                 <select name="new_role" id="new_role">
</span><del>-                                                                <?php
</del><ins>+                                                                <?php
</ins><span class="cx">                                                                 reset( $editblog_roles );
</span><span class="cx">                                                                 foreach( $editblog_roles as $role => $role_assoc ){
</span><span class="cx">                                                                         $name = translate_with_context($role_assoc['name']);
</span><span class="lines">@@ -288,7 +288,7 @@
</span><span class="cx">                                         </table>
</span><span class="cx">                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="cx">                         </div></div>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <div id="blogedit_miscoptions" class="postbox">
</span><span class="cx">                         <h3 class='hndle'><span><?php _e('Misc Blog Actions') ?></span></h3>
</span><span class="cx">                         <div class="inside">
</span><span class="lines">@@ -297,9 +297,9 @@
</span><span class="cx">                                         </table>
</span><span class="cx">                                 <p class="submit" style="margin:-15px 0 -5px 230px;"><input type="submit" name="Submit" value="<?php esc_attr_e('Update Options') ?>" /></p>
</span><span class="cx">                         </div></div>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         </div>
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         <div style="clear:both;"></div>
</span><span class="cx">                 </form>
</span><span class="cx">                 </div>
</span><span class="lines">@@ -324,7 +324,7 @@
</span><span class="cx">                                 WHERE site_id = '{$wpdb->siteid}'
</span><span class="cx">                                 AND {$wpdb->blogs}.blog_id = {$wpdb->registration_log}.blog_id
</span><span class="cx">                                 AND {$wpdb->registration_log}.IP LIKE ('%{$s}%')";
</span><del>-                }
</del><ins>+                }
</ins><span class="cx">
</span><span class="cx">                 if( isset( $_GET['sortby'] ) == false ) {
</span><span class="cx">                         $_GET['sortby'] = 'id';
</span><span class="lines">@@ -407,10 +407,10 @@
</span><span class="cx">                         'registered' => __('Registered'),
</span><span class="cx">                         'users' => __('Users')
</span><span class="cx">                 );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if( has_filter( 'wpmublogsaction' ) )
</span><span class="cx">                         $posts_columns['plugins'] = __('Actions');
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns);
</span><span class="cx">
</span><span class="cx">                 $sortby_url = "s=";
</span><span class="lines">@@ -427,7 +427,7 @@
</span><span class="cx">                                 <th scope="col" class="check-column"></th>
</span><span class="cx">                                 <?php foreach($posts_columns as $column_id => $column_display_name) {
</span><span class="cx">                                         $column_link = "<a href='ms-blogs.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
</span><del>-                                        if( $_GET['sortby'] == $column_id ) {
</del><ins>+                                        if( $_GET['sortby'] == $column_id ) {
</ins><span class="cx">                                                 $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;' : 'order=DESC&amp;';
</span><span class="cx">                                         }
</span><span class="cx">                                         $column_link .= "apage={$apage}'>{$column_display_name}</a>";
</span><span class="lines">@@ -443,7 +443,7 @@
</span><span class="cx">                         if ($blog_list) {
</span><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">@@ -455,7 +455,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                         echo "<tr $bgcolour class='$class'>";
</span><span class="cx">
</span><del>-                                        $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];
</del><ins>+                                        $blogname = ( constant( "VHOST" ) == 'yes' ) ? str_replace('.'.$current_site->domain, '', $blog['domain']) : $blog['path'];
</ins><span class="cx">                                         foreach( $posts_columns as $column_name=>$column_display_name ) {
</span><span class="cx">                                                 switch($column_name) {
</span><span class="cx">                                                         case 'id': ?>
</span><span class="lines">@@ -467,7 +467,7 @@
</span><span class="cx">                                                                 </th>
</span><span class="cx">                                                         <?php
</span><span class="cx">                                                         break;
</span><del>-
</del><ins>+
</ins><span class="cx">                                                         case 'blogname': ?>
</span><span class="cx">                                                                 <td valign="top">
</span><span class="cx">                                                                         <a href="ms-blogs.php?action=editblog&amp;id=<?php echo $blog['blog_id'] ?>" class="edit"><?php echo $blogname; ?></a>
</span><span class="lines">@@ -476,27 +476,27 @@
</span><span class="cx">                                                                         $controlActions        = array();
</span><span class="cx">                                                                         $controlActions[]        = '<a href="ms-blogs.php?action=editblog&amp;id=' . $blog['blog_id'] . '" class="edit">' . __('Edit') . '</a>';
</span><span class="cx">                                                                         $controlActions[]        = "<a href='{$protocol}{$blog['domain']}{$blog['path']}wp-admin/' class='edit'>" . __('Backend') . '</a>';
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         if( get_blog_status( $blog['blog_id'], "deleted" ) == '1' )
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=activateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to activate the blog %s" ), $blogname ) ) . '">' . __('Activate') . '</a>';
</span><span class="cx">                                                                         else
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deactivateblog&amp;ref=' . urlencode( $_SERVER['REQUEST_URI'] ) . '&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to deactivate the blog %s" ), $blogname ) ) . '">' . __('Deactivate') . '</a>';
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         if( get_blog_status( $blog['blog_id'], "archived" ) == '1' )
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unarchiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unarchive the blog %s" ), $blogname ) ) . '">' . __('Unarchive') . '</a>';
</span><span class="cx">                                                                         else
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=archiveblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to archive the blog %s" ), $blogname ) ) . '">' . __('Archive') . '</a>';
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         if( get_blog_status( $blog['blog_id'], "spam" ) == '1' )
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=unspamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to unspam the blog %s" ), $blogname ) ) . '">' . __('Not Spam') . '</a>';
</span><span class="cx">                                                                         else
</span><span class="cx">                                                                                 $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=spamblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to mark the blog %s as spam" ), $blogname ) ) . '">' . __("Spam") . '</a>';
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         $controlActions[]        = '<a class="delete" href="ms-edit.php?action=confirm&amp;action2=deleteblog&amp;id=' . $blog['blog_id'] . '&amp;msg=' . urlencode( sprintf( __( "You are about to delete the blog %s" ), $blogname ) ) . '">' . __("Delete") . '</a>';
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         $controlActions[]        = "<a href='http://{$blog['domain']}{$blog['path']}' rel='permalink'>" . __('Visit') . '</a>';
</span><span class="cx">                                                                         ?>
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         <?php if (count($controlActions)) : ?>
</span><span class="cx">                                                                         <div class="row-actions">
</span><span class="cx">                                                                                 <?php echo implode(' | ', $controlActions); ?>
</span><span class="lines">@@ -505,7 +505,7 @@
</span><span class="cx">                                                                 </td>
</span><span class="cx">                                                         <?php
</span><span class="cx">                                                         break;
</span><del>-
</del><ins>+
</ins><span class="cx">                                                         case 'lastupdated': ?>
</span><span class="cx">                                                                 <td valign="top">
</span><span class="cx">                                                                         <?php echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date(__('Y-m-d \<\b\r \/\> g:i:s a'), $blog['last_updated']); ?>
</span><span class="lines">@@ -522,7 +522,7 @@
</span><span class="cx">                                                         case 'users': ?>
</span><span class="cx">                                                                 <td valign="top">
</span><span class="cx">                                                                         <?php
</span><del>-                                                                        $blogusers = get_users_of_blog( $blog['blog_id'] );
</del><ins>+                                                                        $blogusers = get_users_of_blog( $blog['blog_id'] );
</ins><span class="cx">                                                                         if ( is_array( $blogusers ) ) {
</span><span class="cx">                                                                                 $blogusers_warning = '';
</span><span class="cx">                                                                                 if ( count( $blogusers ) > 5 ) {
</span><span class="lines">@@ -530,7 +530,7 @@
</span><span class="cx">                                                                                         $blogusers_warning = __( 'Only showing first 5 users.' ) . ' <a href="' . $protocol . $blog[ 'domain' ] . $blog[ 'path' ] . 'wp-admin/users.php">' . __( 'More' ) . '</a>';
</span><span class="cx">                                                                                 }
</span><span class="cx">                                                                                 foreach ( $blogusers as $key => $val ) {
</span><del>-                                                                                        echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
</del><ins>+                                                                                        echo '<a href="user-edit.php?user_id=' . $val->user_id . '">' . $val->user_login . '</a> ('.$val->user_email.')<br />';
</ins><span class="cx">                                                                                 }
</span><span class="cx">                                                                                 if( $blogusers_warning != '' ) {
</span><span class="cx">                                                                                         echo '<strong>' . $blogusers_warning . '</strong><br />';
</span><span class="lines">@@ -548,7 +548,7 @@
</span><span class="cx">                                                                 </td>
</span><span class="cx">                                                                 <?php } ?>
</span><span class="cx">                                                         <?php break;
</span><del>-
</del><ins>+
</ins><span class="cx">                                                         default: ?>
</span><span class="cx">                                                                 <?php if( has_filter( 'manage_blogs_custom_column' ) ) { ?>
</span><span class="cx">                                                                 <td valign="top">
</span><span class="lines">@@ -563,9 +563,9 @@
</span><span class="cx">                                         <?php
</span><span class="cx">                                 }
</span><span class="cx">                         } else { ?>
</span><del>-                                <tr style='background-color: <?php echo $bgcolor; ?>'>
-                                        <td colspan="8"><?php _e('No blogs found.') ?></td>
-                                </tr>
</del><ins>+                                <tr style='background-color: <?php echo $bgcolor; ?>'>
+                                        <td colspan="8"><?php _e('No blogs found.') ?></td>
+                                </tr>
</ins><span class="cx">                         <?php
</span><span class="cx">                         } // end if ($blogs)
</span><span class="cx">                         ?>
</span><span class="lines">@@ -585,10 +585,10 @@
</span><span class="cx">                                                 <th style="text-align:center;" scope='row'><?php _e('Blog Address') ?></th>
</span><span class="cx">                                                 <td>
</span><span class="cx">                                                 <?php if ( constant( "VHOST" ) == 'yes' ) { ?>
</span><del>-                                                        <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
</del><ins>+                                                        <input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>.<?php echo $current_site->domain;?>
</ins><span class="cx">                                                 <?php } else {
</span><span class="cx">                                                         echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" title="<?php _e('Domain') ?>"/>
</span><del>-                                                <?php }
</del><ins>+                                                <?php }
</ins><span class="cx">                                                 echo "<p>" . __( 'Only the characters a-z and 0-9 recommended.' ) . "</p>";
</span><span class="cx">                                                 ?>
</span><span class="cx">                                                 </td>
</span></span></pre></div>
<a id="trunkwpadminmsupgradesitephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-upgrade-site.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-upgrade-site.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-upgrade-site.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">                                                 wp_die( "<strong>Warning!</strong> Problem upgrading {$siteurl}. Your server may not be able to connect to blogs running on it.<br /> Error message: <em>" . $response->get_error_message() ."</em>" );
</span><span class="cx">                                         }
</span><span class="cx">                                         do_action( 'after_mu_upgrade', $response );
</span><del>-                                        do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
</del><ins>+                                        do_action( 'wpmu_upgrade_site', $details[ 'blog_id' ] );
</ins><span class="cx">                                 }
</span><span class="cx">                         }
</span><span class="cx">                         echo "</ul>";
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">                         echo '<p>'.__('All Done!').'</p>';
</span><span class="cx">                 }
</span><span class="cx">         break;
</span><del>-        default:
</del><ins>+        default:
</ins><span class="cx">                 ?><p><?php _e("You can upgrade all the blogs on your site through this page. It works by calling the upgrade script of each blog automatically. Hit the link below to upgrade."); ?></p>
</span><span class="cx">                 <p><a class="button" href="ms-upgrade-site.php?action=upgrade"><?php _e("Upgrade Site"); ?></a></p><?php
</span><span class="cx">                 do_action( 'wpmu_upgrade_page' );
</span></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-users.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-admin/ms-users.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -26,9 +26,9 @@
</span><span class="cx">                         case 'all_spam':
</span><span class="cx">                                 _e('Users marked as spam !');
</span><span class="cx">                         break;
</span><del>-                        case 'all_notspam':
-                                _e('Users marked as not spam !');
-                        break;
</del><ins>+                        case 'all_notspam':
+                                _e('Users marked as not spam !');
+                        break;
</ins><span class="cx">                         case 'all_delete':
</span><span class="cx">                                 _e('Users deleted !');
</span><span class="cx">                         break;
</span><span class="lines">@@ -85,12 +85,12 @@
</span><span class="cx">
</span><span class="cx">         // Pagination
</span><span class="cx">         $user_navigation = paginate_links( array(
</span><del>-                'total' => ceil($total / $num),        
</del><ins>+                'total' => ceil($total / $num),
</ins><span class="cx">                 'current' => $apage,
</span><span class="cx">                 'base' => add_query_arg( 'apage', '%#%' ),
</span><span class="cx">                 'format' => ''
</span><span class="cx">         ));
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( $user_navigation ) {
</span><span class="cx">                 $user_navigation = sprintf( '<span class="displaying-num">' . __( 'Displaying %s&#8211;%s of %s' ) . '</span>%s',
</span><span class="cx">                         number_format_i18n( ( $apage - 1 ) * $num + 1 ),
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">                         $user_navigation
</span><span class="cx">                 );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         ?>
</span><span class="cx">         <div class="wrap">
</span><span class="cx">         <h2><?php _e( $current_site->site_name ); ?> <?php _e("Users"); ?></h2>
</span><span class="lines">@@ -157,11 +157,11 @@
</span><span class="cx">                         <tbody id="users" class="list:user user-list">
</span><span class="cx">                         <?php if ($user_list) {
</span><span class="cx">                                 $bgcolor = '';
</span><del>-                                foreach ( (array) $user_list as $user) {
</del><ins>+                                foreach ( (array) $user_list as $user) {
</ins><span class="cx">                                         $class = ('alternate' == $class) ? '' : 'alternate';
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         $status_list = array( "spam" => "#faa", "deleted" => "#f55" );
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         $bgcolour = "";
</span><span class="cx">                                         foreach ( $status_list as $status => $col ) {
</span><span class="cx">                                                 if( $user[$status] ) {
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">                                                 switch($column_name) {
</span><span class="cx">                                                         case 'checkbox': ?>
</span><span class="cx">                                                                 <th scope="row" class="check-column"><input type='checkbox' id='user_<?php echo $user['ID'] ?>' name='allusers[]' value='<?php echo esc_attr($user['ID']) ?>' /></th>
</span><del>-                                                        <?php
</del><ins>+                                                        <?php
</ins><span class="cx">                                                         break;
</span><span class="cx">
</span><span class="cx">                                                         case 'login':
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx">                                                         <?php
</span><span class="cx">                                                         break;
</span><span class="cx">
</span><del>-                                                        case 'blogs':
</del><ins>+                                                        case 'blogs':
</ins><span class="cx">                                                                 $blogs = get_blogs_of_user( $user['ID'], true );
</span><span class="cx">                                                                 ?>
</span><span class="cx">                                                                 <td>
</span><span class="lines">@@ -222,17 +222,17 @@
</span><span class="cx">                                                                                         $path        = ($val->path == '/') ? '' : $val->path;
</span><span class="cx">                                                                                         echo '<a href="ms-blogs.php?action=editblog&amp;id=' . $val->userblog_id . '">' . str_replace( '.' . $current_site->domain, '', $val->domain . $path ) . '</a>';
</span><span class="cx">                                                                                         echo ' <small class="row-actions">';
</span><del>-                                                                                        
</del><ins>+
</ins><span class="cx">                                                                                         // Edit
</span><span class="cx">                                                                                         echo '<a href="ms-blogs.php?action=editblog&amp;id=' . $val->userblog_id . '">' . __('Edit') . '</a> | ';
</span><del>-                                                                                        
</del><ins>+
</ins><span class="cx">                                                                                         // View
</span><del>-                                                                                        echo '<a ';
</del><ins>+                                                                                        echo '<a ';
</ins><span class="cx">                                                                                         if( get_blog_status( $val->userblog_id, 'spam' ) == 1 )
</span><span class="cx">                                                                                                 echo 'style="background-color: #f66" ';
</span><span class="cx">                                                                                         echo 'target="_new" href="http://'.$val->domain . $val->path.'">' . __('View') . '</a>';
</span><del>-                                                                                        
-                                                                                        echo '</small><br />';
</del><ins>+
+                                                                                        echo '</small><br />';
</ins><span class="cx">                                                                                 }
</span><span class="cx">                                                                         }
</span><span class="cx">                                                                         ?>
</span><span class="lines">@@ -247,20 +247,20 @@
</span><span class="cx">                                                 }
</span><span class="cx">                                         endforeach
</span><span class="cx">                                         ?>
</span><del>-                                        </tr>
</del><ins>+                                        </tr>
</ins><span class="cx">                                         <?php
</span><span class="cx">                                 }
</span><span class="cx">                         } else {
</span><span class="cx">                         ?>
</span><del>-                                <tr style='background-color: <?php echo $bgcolor; ?>'>
-                                        <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td>
-                                </tr>
</del><ins>+                                <tr style='background-color: <?php echo $bgcolor; ?>'>
+                                        <td colspan="<?php echo (int) count($posts_columns); ?>"><?php _e('No users found.') ?></td>
+                                </tr>
</ins><span class="cx">                                 <?php
</span><span class="cx">                         } // end if ($users)
</span><del>-                        ?>
</del><ins>+                        ?>
</ins><span class="cx">                         </tbody>
</span><span class="cx">                 </table>
</span><del>-                
</del><ins>+
</ins><span class="cx">                 <div class="tablenav">
</span><span class="cx">                         <?php if ( $user_navigation ) echo "<div class='tablenav-pages'>$user_navigation</div>"; ?>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-includes/ms-functions.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">
</span><span class="cx"> function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
</span><span class="cx">         global $wpdb;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if( $sitedomain == '' ) {
</span><span class="cx">                 $site_id = $wpdb->siteid;
</span><span class="cx">         } else {
</span><span class="lines">@@ -187,7 +187,7 @@
</span><span class="cx"> * Determine if user is a site admin.
</span><span class="cx"> *
</span><span class="cx"> * @deprecated Use {@link is_keymaster()}
</span><del>- *
</del><ins>+ *
</ins><span class="cx"> */
</span><span class="cx"> function is_site_admin( $user_login = '' ) {
</span><span class="cx">         // This function must reside in a file included only if is_multsite() since many plugins
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx">
</span><span class="cx"> function add_blog_option( $id, $key, $value ) {
</span><span class="cx">         $id = (int) $id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_to_blog($id);
</span><span class="cx">         add_option( $key, $value );
</span><span class="cx">         restore_current_blog();
</span><span class="lines">@@ -278,7 +278,7 @@
</span><span class="cx">
</span><span class="cx"> function delete_blog_option( $id, $key ) {
</span><span class="cx">         $id = (int) $id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_to_blog($id);
</span><span class="cx">         delete_option( $key );
</span><span class="cx">         restore_current_blog();
</span><span class="lines">@@ -287,7 +287,7 @@
</span><span class="cx">
</span><span class="cx"> function update_blog_option( $id, $key, $value, $refresh = true ) {
</span><span class="cx">         $id = (int) $id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         switch_to_blog($id);
</span><span class="cx">         update_option( $key, $value );
</span><span class="cx">         restore_current_blog();
</span><span class="lines">@@ -308,8 +308,8 @@
</span><span class="cx">
</span><span class="cx">         $switched_stack[] = $blog_id;
</span><span class="cx">
</span><del>-        /* If we're switching to the same blog id that we're on,
-        * set the right vars, do the associated actions, but skip
</del><ins>+        /* If we're switching to the same blog id that we're on,
+        * set the right vars, do the associated actions, but skip
</ins><span class="cx">         * the extra unnecessary work */
</span><span class="cx">         if ( $blog_id == $new_blog ) {
</span><span class="cx">                 do_action( 'switch_blog', $blog_id, $blog_id );
</span><span class="lines">@@ -407,7 +407,7 @@
</span><span class="cx">
</span><span class="cx">         do_action('switch_blog', $blog_id, $prev_blog_id);
</span><span class="cx">
</span><del>-        /* If we still have items in the switched stack, consider ourselves still 'switched' */
</del><ins>+        /* If we still have items in the switched stack, consider ourselves still 'switched' */
</ins><span class="cx">         $switched = ( is_array( $switched_stack ) && count( $switched_stack ) > 0 );
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="lines">@@ -511,12 +511,12 @@
</span><span class="cx"> function is_user_member_of_blog( $user_id, $blog_id = 0 ) {
</span><span class="cx">         $user_id = (int) $user_id;
</span><span class="cx">         $blog_id = (int) $blog_id;
</span><del>-        
</del><ins>+
</ins><span class="cx">         if( $blog_id == 0 ) {
</span><span class="cx">                 global $wpdb;
</span><span class="cx">                 $blog_id = $wpdb->blogid;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $blogs = get_blogs_of_user( $user_id );
</span><span class="cx">         if( is_array( $blogs ) ) {
</span><span class="cx">                 return array_key_exists( $blog_id, $blogs );
</span><span class="lines">@@ -906,9 +906,9 @@
</span><span class="cx">
</span><span class="cx"> function is_email_address_unsafe( $user_email ) {
</span><span class="cx">         $banned_names = get_site_option( "banned_email_domains" );
</span><del>-        if ($banned_names && !is_array( $banned_names )) {
-                $banned_names = explode( "\n", $banned_names);
-        }
</del><ins>+        if ($banned_names && !is_array( $banned_names )) {
+                $banned_names = explode( "\n", $banned_names);
+        }
</ins><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><span class="cx">                 foreach( (array) $banned_names as $banned_domain ) {
</span><span class="lines">@@ -1116,15 +1116,15 @@
</span><span class="cx">         $domain = $wpdb->escape($domain);
</span><span class="cx">         $path = $wpdb->escape($path);
</span><span class="cx">         $title = $wpdb->escape($title);
</span><del>-                                        
</del><ins>+
</ins><span class="cx">         $wpdb->insert( $wpdb->signups, array(
</span><del>-                'domain' => $domain,
-                'path' => $path,
</del><ins>+                'domain' => $domain,
+                'path' => $path,
</ins><span class="cx">                 'title' => $title,
</span><del>-                'user_login' => $user,
-                'user_email' => $user_email,
</del><ins>+                'user_login' => $user,
+                'user_email' => $user_email,
</ins><span class="cx">                 'registered' => current_time('mysql', true),
</span><del>-                'activation_key' => $key,
</del><ins>+                'activation_key' => $key,
</ins><span class="cx">                 'meta' => $meta
</span><span class="cx">         ) );
</span><span class="cx">
</span><span class="lines">@@ -1139,15 +1139,15 @@
</span><span class="cx">         $user_email = sanitize_email( $user_email );
</span><span class="cx">         $key = substr( md5( time() . rand() . $user_email ), 0, 16 );
</span><span class="cx">         $meta = serialize($meta);
</span><del>-                                        
</del><ins>+
</ins><span class="cx">         $wpdb->insert( $wpdb->signups, array(
</span><del>-                'domain' => '',
-                'path' => '',
</del><ins>+                'domain' => '',
+                'path' => '',
</ins><span class="cx">                 'title' => '',
</span><del>-                'user_login' => $user,
-                'user_email' => $user_email,
</del><ins>+                'user_login' => $user,
+                'user_email' => $user_email,
</ins><span class="cx">                 'registered' => current_time('mysql', true),
</span><del>-                'activation_key' => $key,
</del><ins>+                'activation_key' => $key,
</ins><span class="cx">                 'meta' => $meta
</span><span class="cx">         ) );
</span><span class="cx">
</span><span class="lines">@@ -1343,25 +1343,25 @@
</span><span class="cx">         global $current_site;
</span><span class="cx">         if( get_site_option( 'registrationnotification' ) != 'yes' )
</span><span class="cx">                 return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">         $email = get_site_option( 'admin_email' );
</span><span class="cx">         if( is_email($email) == false )
</span><span class="cx">                 return false;
</span><del>-        
</del><ins>+
</ins><span class="cx">         $options_site_url = clean_url("http://{$current_site->domain}{$current_site->path}wp-admin/ms-options.php");
</span><span class="cx">
</span><span class="cx">         switch_to_blog( $blog_id );
</span><span class="cx">         $blogname = get_option( 'blogname' );
</span><span class="cx">         $siteurl = get_option( 'siteurl' );
</span><span class="cx">         restore_current_blog();
</span><del>-        
</del><ins>+
</ins><span class="cx">         $msg = sprintf( __( "New Blog: %1s
</span><span class="cx"> URL: %2s
</span><span class="cx"> Remote IP: %3s
</span><span class="cx">
</span><span class="cx"> Disable these notifications: %4s"), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);
</span><span class="cx">         $msg = apply_filters( 'newblog_notify_siteadmin', $msg );
</span><del>-        
</del><ins>+
</ins><span class="cx">         wp_mail( $email, sprintf( __( "New Blog Registration: %s" ), $siteurl ), $msg );
</span><span class="cx">         return true;
</span><span class="cx"> }
</span><span class="lines">@@ -1370,7 +1370,7 @@
</span><span class="cx">         global $current_site;
</span><span class="cx">         if( get_site_option( 'registrationnotification' ) != 'yes' )
</span><span class="cx">                 return false;
</span><del>-                
</del><ins>+
</ins><span class="cx">         $email = get_site_option( 'admin_email' );
</span><span class="cx">         if( is_email($email) == false )
</span><span class="cx">                 return false;
</span><span class="lines">@@ -1381,7 +1381,7 @@
</span><span class="cx"> Remote IP: %2s
</span><span class="cx">
</span><span class="cx"> Disable these notifications: %3s"), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);
</span><del>-        
</del><ins>+
</ins><span class="cx">         $msg = apply_filters( 'newuser_notify_siteadmin', $msg );
</span><span class="cx">         wp_mail( $email, sprintf(__("New User Registration: %s"), $user->user_login), $msg );
</span><span class="cx">         return true;
</span><span class="lines">@@ -1416,7 +1416,7 @@
</span><span class="cx">
</span><span class="cx">         require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
</span><span class="cx">
</span><del>-        if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") )
</del><ins>+        if ( $wpdb->get_results("SELECT ID FROM $wpdb->posts") )
</ins><span class="cx">                 die(__('<h1>Already Installed</h1><p>You appear to have already installed WordPress. To reinstall please clear your old database tables first.</p>') . '</body></html>');
</span><span class="cx">         $wpdb->suppress_errors( false);
</span><span class="cx">
</span><span class="lines">@@ -1444,7 +1444,7 @@
</span><span class="cx">         // Default link category
</span><span class="cx">         $cat_name = __('Blogroll');
</span><span class="cx">         $cat_slug = sanitize_title($cat_name);
</span><del>-        
</del><ins>+
</ins><span class="cx">         $blogroll_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) );
</span><span class="cx">         if( $blogroll_id == null ) {
</span><span class="cx">                 $wpdb->insert( $wpdb->sitecategories, array('cat_ID' => 0, 'cat_name' => $cat_name, 'category_nicename' => $cat_slug, 'last_updated' => current_time('mysql', true)) );
</span><span class="lines">@@ -1487,11 +1487,11 @@
</span><span class="cx">         $first_post = str_replace( "SITE_URL", clean_url("http://" . $current_site->domain . $current_site->path), $first_post );
</span><span class="cx">         $first_post = str_replace( "SITE_NAME", $current_site->site_name, $first_post );
</span><span class="cx">         $wpdb->insert( $wpdb->posts, array(
</span><del>-                'post_author' => $user_id,
-                'post_date' => $now,
</del><ins>+                'post_author' => $user_id,
+                'post_date' => $now,
</ins><span class="cx">                 'post_date_gmt' => $now_gmt,
</span><del>-                'post_content' => stripslashes( $first_post ),
-                'post_excerpt' => '',
</del><ins>+                'post_content' => stripslashes( $first_post ),
+                'post_excerpt' => '',
</ins><span class="cx">                 'post_title' => __('Hello world!'),
</span><span class="cx">                 'post_name' => __('hello-world'),
</span><span class="cx">                 'post_modified' => $now,
</span><span class="lines">@@ -1506,11 +1506,11 @@
</span><span class="cx">
</span><span class="cx">         // First page
</span><span class="cx">         $wpdb->insert( $wpdb->posts, array(
</span><del>-                'post_author' => $user_id,
-                'post_date' => $now,
</del><ins>+                'post_author' => $user_id,
+                'post_date' => $now,
</ins><span class="cx">                 'post_date_gmt' => $now_gmt,
</span><span class="cx">                 'post_content' => get_site_option( 'first_page' ),
</span><del>-                'post_excerpt' => '',
</del><ins>+                'post_excerpt' => '',
</ins><span class="cx">                 'post_title' => __('About'),
</span><span class="cx">                 'post_name' => __('about'),
</span><span class="cx">                 'post_modified' => $now,
</span><span class="lines">@@ -1521,30 +1521,30 @@
</span><span class="cx">                 'pinged' => '',
</span><span class="cx">                 'post_content_filtered' => ''
</span><span class="cx">         ) );
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Flush rules to pick up the new page.
</span><span class="cx">         $wp_rewrite->init();
</span><span class="cx">         $wp_rewrite->flush_rules();
</span><span class="cx">
</span><span class="cx">         // Default comment
</span><span class="cx">         $wpdb->insert( $wpdb->comments, array(
</span><del>-                'comment_post_ID' => '1',
</del><ins>+                'comment_post_ID' => '1',
</ins><span class="cx">                 'comment_author' => __( get_site_option( 'first_comment_author' ) ),
</span><span class="cx">                 'comment_author_email' => '',
</span><span class="cx">                 'comment_author_url' => get_site_option( 'first_comment_url' ),
</span><del>-                'comment_author_IP' => '127.0.0.1',
</del><ins>+                'comment_author_IP' => '127.0.0.1',
</ins><span class="cx">                 'comment_date' => $now,
</span><del>-                'comment_date_gmt' => $now_gmt,
</del><ins>+                'comment_date_gmt' => $now_gmt,
</ins><span class="cx">                 'comment_content' => __( get_site_option( 'first_comment' ) )
</span><span class="cx">         ) );
</span><del>-        
</del><ins>+
</ins><span class="cx">         $user = new WP_User($user_id);
</span><span class="cx">         $wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') );
</span><span class="cx">
</span><span class="cx">         // Remove all perms except for the login user.
</span><span class="cx">         $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'user_level') );
</span><span class="cx">         $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id != %d AND meta_key = %s", $user_id, $table_prefix.'capabilities') );
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) TODO: Get previous_blog_id.
</span><span class="cx">         if ( !is_site_admin( $user->user_login ) && $user_id != 1 )
</span><span class="cx">                 $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d AND meta_key = %s", $user_id, $wpdb->base_prefix.'1_capabilities') );
</span><span class="lines">@@ -1605,7 +1605,7 @@
</span><span class="cx">         if( !apply_filters('wpmu_welcome_user_notification', $user_id, $password, $meta) )
</span><span class="cx">                 return false;
</span><span class="cx">
</span><del>-        $welcome_email = get_site_option( 'welcome_user_email' );
</del><ins>+        $welcome_email = get_site_option( 'welcome_user_email' );
</ins><span class="cx">
</span><span class="cx">         $user = new WP_User($user_id);
</span><span class="cx">
</span><span class="lines">@@ -1746,12 +1746,12 @@
</span><span class="cx">         }
</span><span class="cx">         $spaceAllowed = get_space_allowed();
</span><span class="cx">         if(empty($spaceAllowed) || !is_numeric($spaceAllowed))
</span><del>-                $spaceAllowed = 10;        // Default space allowed is 10 MB
-        
</del><ins>+                $spaceAllowed = 10;        // Default space allowed is 10 MB
+
</ins><span class="cx">         $dirName = BLOGUPLOADDIR;
</span><span class="cx">         $size = get_dirsize($dirName) / 1024 / 1024;
</span><del>-        
-        if( ($spaceAllowed-$size) < 0 ) {
</del><ins>+
+        if( ($spaceAllowed-$size) < 0 ) {
</ins><span class="cx">                 if( $echo )
</span><span class="cx">                         _e( "Sorry, you have used your space allocation. Please delete some files to upload more files." ); //No space left
</span><span class="cx">                 return true;
</span><span class="lines">@@ -1787,7 +1787,7 @@
</span><span class="cx">         if( upload_is_user_over_quota( false ) == true ) {
</span><span class="cx">                 return 0;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $spaceAllowed = 1024 * 1024 * get_space_allowed();
</span><span class="cx">         $dirName = BLOGUPLOADDIR;
</span><span class="cx">         $dirsize = get_dirsize($dirName) ;
</span><span class="lines">@@ -1801,7 +1801,7 @@
</span><span class="cx"> if ( !function_exists('graceful_fail') ) :
</span><span class="cx"> function graceful_fail( $message ) {
</span><span class="cx">         $message = apply_filters('graceful_fail', $message);
</span><del>-        $message_template = apply_filters( 'graceful_fail_template',
</del><ins>+        $message_template = apply_filters( 'graceful_fail_template',
</ins><span class="cx"> '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
</span><span class="cx"> <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
</span><span class="cx"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</span><span class="lines">@@ -1843,7 +1843,7 @@
</span><span class="cx">                         return false;
</span><span class="cx">
</span><span class="cx">                 if( $this->reallydeleteblog == true ) {
</span><del>-                        wpmu_delete_blog( $wpdb->blogid );
</del><ins>+                        wpmu_delete_blog( $wpdb->blogid );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -1862,14 +1862,14 @@
</span><span class="cx">                         update_option( "delete_blog_hash", $hash );
</span><span class="cx">                         $url_delete = get_option( "siteurl" ) . "/wp-admin/options-general.php?page=delete-blog&h=" . $hash;
</span><span class="cx">                         $msg = __("Dear User,
</span><del>-You recently clicked the 'Delete Blog' link on your blog and filled in a
</del><ins>+You recently clicked the 'Delete Blog' link on your blog and filled in a
</ins><span class="cx"> form on that page.
</span><span class="cx"> If you really want to delete your blog, click the link below. You will not
</span><span class="cx"> be asked to confirm again so only click this link if you are 100% certain:
</span><span class="cx"> URL_DELETE
</span><span class="cx">
</span><span class="cx"> If you delete your blog, please consider opening a new blog here
</span><del>-some time in the future! (But remember your current blog and username
</del><ins>+some time in the future! (But remember your current blog and username
</ins><span class="cx"> are gone forever.)
</span><span class="cx">
</span><span class="cx"> Thanks for using the site,
</span><span class="lines">@@ -1932,8 +1932,8 @@
</span><span class="cx">
</span><span class="cx">         clean_term_cache($term_id);
</span><span class="cx">
</span><del>-        return $global_id;
-}
</del><ins>+        return $global_id;
+}
</ins><span class="cx">
</span><span class="cx"> function redirect_this_site( $deprecated = '' ) {
</span><span class="cx">         global $current_site;
</span><span class="lines">@@ -1944,7 +1944,7 @@
</span><span class="cx">         if( is_array( $upload ) == false || defined( 'WP_IMPORTING' ) )
</span><span class="cx">                 return $upload;
</span><span class="cx">         if( strlen( $upload[ 'bits' ] ) > ( 1024 * get_site_option( 'fileupload_maxk', 1500 ) ) ) {
</span><del>-                return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 ));
</del><ins>+                return sprintf(__( "This file is too big. Files must be less than %dKb in size.<br />" ), get_site_option( 'fileupload_maxk', 1500 ));
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         return $upload;
</span><span class="lines">@@ -2112,7 +2112,7 @@
</span><span class="cx">         return strtolower( $username );
</span><span class="cx"> }
</span><span class="cx">
</span><del>-/* Short circuit the update checks. Make sure update informtion is
</del><ins>+/* Short circuit the update checks. Make sure update informtion is
</ins><span class="cx"> stored in wp_sitemeta rather than the options table of individual blogs */
</span><span class="cx">
</span><span class="cx"> // update_plugins (transient)
</span><span class="lines">@@ -2197,8 +2197,8 @@
</span><span class="cx">         global $current_site, $current_blog;
</span><span class="cx">
</span><span class="cx">         $dashboard_blog = get_dashboard_blog();
</span><del>-        if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {
-                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</del><ins>+        if ( $current_blog->blog_id == $dashboard_blog->blog_id && $dashboard_blog->blog_id != $current_site->blog_id ) {
+                $protocol = ( is_ssl() ? 'https://' : 'http://' );
</ins><span class="cx">                 wp_redirect( $protocol . $dashboard_blog->domain . trailingslashit( $dashboard_blog->path ) . 'wp-admin/' );
</span><span class="cx">                 die();
</span><span class="cx">         }
</span><span class="lines">@@ -2222,7 +2222,7 @@
</span><span class="cx">                 $user_id = $current_user->ID;
</span><span class="cx">         if( $blog_id == 0 )
</span><span class="cx">                 $blog_id = $wpdb->blogid;
</span><del>-        
</del><ins>+
</ins><span class="cx">         $local_key = $wpdb->base_prefix . $blog_id . "_" . $key;
</span><span class="cx">         if( isset( $current_user->$local_key ) )
</span><span class="cx">                 return true;
</span><span class="lines">@@ -2346,7 +2346,7 @@
</span><span class="cx">
</span><span class="cx">         if ( !$active_sitewide_plugins )
</span><span class="cx">                 return $active_plugins;
</span><del>-        
</del><ins>+
</ins><span class="cx">         $plugins = array_merge( (array) $active_plugins, array_keys( (array) $active_sitewide_plugins ) );
</span><span class="cx">         sort( $plugins );
</span><span class="cx">         return $plugins;
</span></span></pre></div>
<a id="trunkwpincludesmssettingsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-settings.php (12631 => 12632)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-settings.php        2010-01-07 04:23:23 UTC (rev 12631)
+++ trunk/wp-includes/ms-settings.php        2010-01-07 04:27:46 UTC (rev 12632)
</span><span class="lines">@@ -53,7 +53,7 @@
</span><span class="cx">         $current_site = wp_cache_get( "current_site", "site-options" );
</span><span class="cx">         if( $current_site )
</span><span class="cx">                 return $current_site;
</span><del>-                
</del><ins>+
</ins><span class="cx">         $wpdb->suppress_errors();
</span><span class="cx">         $sites = $wpdb->get_results( "SELECT * FROM $wpdb->site" ); // usually only one site
</span><span class="cx">         if( count( $sites ) == 1 ) {
</span></span></pre>
</div>
</div>
</body>
</html>