<!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>[12826] trunk: phpdoc and cleanup.</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/12826">12826</a></dd>
<dt>Author</dt> <dd>ryan</dd>
<dt>Date</dt> <dd>2010-01-25 22:01:43 +0000 (Mon, 25 Jan 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>phpdoc and cleanup. 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="#trunkwpincludesmsfunctionsphp">trunk/wp-includes/ms-functions.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 (12825 => 12826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/ms.php        2010-01-25 21:33:49 UTC (rev 12825)
+++ trunk/wp-admin/includes/ms.php        2010-01-25 22:01:43 UTC (rev 12826)
</span><span class="lines">@@ -1,8 +1,17 @@
</span><span class="cx"> &lt;?php
</span><ins>+
+/**
+ * Determine if uploaded file exceeds space quota.
+ *
+ * @since 3.0
+ *
+ * @param array $file $_FILES array for a given file.
+ * @return array $_FILES array with 'error' key set if file exceeds quota. 'error' is empty otherwise.
+ */
</ins><span class="cx"> function check_upload_size( $file ) {
</span><del>-        if ( get_site_option( 'upload_space_check_disabled' ) ) {
</del><ins>+        if ( get_site_option( 'upload_space_check_disabled' ) )
</ins><span class="cx">                 return $file;
</span><del>-        }
</del><ins>+
</ins><span class="cx">         if ( $file['error'] != '0' ) // there's already an error
</span><span class="cx">                 return $file;
</span><span class="cx"> 
</span><span class="lines">@@ -27,6 +36,15 @@
</span><span class="cx"> }
</span><span class="cx"> add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
</span><span class="cx"> 
</span><ins>+/**
+ * Delete a blog
+ *
+ * @since 3.0
+ *
+ * @param int $blog_id Blog ID
+ * @param bool $drop True if blog's table should be dropped.  Default is false.
+ * @return void
+ */
</ins><span class="cx"> function wpmu_delete_blog($blog_id, $drop = false) {
</span><span class="cx">         global $wpdb;
</span><span class="cx"> 
</span><span class="lines">@@ -40,8 +58,10 @@
</span><span class="cx">         $users = get_users_of_blog($blog_id);
</span><span class="cx"> 
</span><span class="cx">         // Remove users from this blog.
</span><del>-        if ( !empty($users) ) foreach ($users as $user) {
-                remove_user_from_blog($user-&gt;user_id, $blog_id);
</del><ins>+        if ( !empty($users) ) {
+                foreach ($users as $user) {
+                        remove_user_from_blog($user-&gt;user_id, $blog_id);
+                }
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         update_blog_status( $blog_id, 'deleted', 1 );
</span><span class="lines">@@ -61,13 +81,13 @@
</span><span class="cx">                 $stack = array($dir);
</span><span class="cx">                 $index = 0;
</span><span class="cx"> 
</span><del>-                while ($index &lt; count($stack)) {
</del><ins>+                while ( $index &lt; count($stack) ) {
</ins><span class="cx">                         # Get indexed directory from stack
</span><span class="cx">                         $dir = $stack[$index];
</span><span class="cx"> 
</span><span class="cx">                         $dh = @ opendir($dir);
</span><del>-                        if ($dh) {
-                                while (($file = @ readdir($dh)) !== false) {
</del><ins>+                        if ( $dh ) {
+                                while ( ($file = @ readdir($dh)) !== false ) {
</ins><span class="cx">                                         if ($file == '.' or $file == '..')
</span><span class="cx">                                                 continue;
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +101,7 @@
</span><span class="cx">                 }
</span><span class="cx"> 
</span><span class="cx">                 $stack = array_reverse($stack);  // Last added dirs are deepest
</span><del>-                foreach( (array) $stack as $dir) {
</del><ins>+                foreach( (array) $stack as $dir ) {
</ins><span class="cx">                         if ( $dir != $top_dir)
</span><span class="cx">                         @rmdir($dir);
</span><span class="cx">                 }
</span><span class="lines">@@ -89,10 +109,9 @@
</span><span class="cx">         $wpdb-&gt;query( $wpdb-&gt;prepare(&quot;DELETE FROM {$wpdb-&gt;usermeta} WHERE meta_key = %s&quot;, 'wp_{$blog_id}_autosave_draft_ids') );
</span><span class="cx">         $blogs = get_site_option( &quot;blog_list&quot; );
</span><span class="cx">         if ( is_array( $blogs ) ) {
</span><del>-                foreach( $blogs as $n =&gt; $blog ) {
-                        if ( $blog[ 'blog_id' ] == $blog_id ) {
</del><ins>+                foreach ( $blogs as $n =&gt; $blog ) {
+                        if ( $blog[ 'blog_id' ] == $blog_id )
</ins><span class="cx">                                 unset( $blogs[ $n ] );
</span><del>-                        }
</del><span class="cx">                 }
</span><span class="cx">                 update_site_option( 'blog_list', $blogs );
</span><span class="cx">         }
</span><span class="lines">@@ -152,9 +171,8 @@
</span><span class="cx">         foreach ( (array) $_POST['allusers'] as $key =&gt; $val ) {
</span><span class="cx">                 if ( $val != '' &amp;&amp; $val != '0' ) {
</span><span class="cx">                         $user = new WP_User( $val );
</span><del>-                        if ( in_array( $user-&gt;user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) ) {
</del><ins>+                        if ( in_array( $user-&gt;user_login, get_site_option( 'site_admins', array( 'admin' ) ) ) )
</ins><span class="cx">                                 wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a site admnistrator.' ), $user-&gt;user_login ) );
</span><del>-                        }
</del><span class="cx">                         echo &quot;&lt;input type='hidden' name='user[]' value='{$val}'/&gt;\n&quot;;
</span><span class="cx">                         $blogs = get_blogs_of_user( $val, true );
</span><span class="cx">                         if ( !empty( $blogs ) ) {
</span><span class="lines">@@ -164,7 +182,7 @@
</span><span class="cx">                                                 echo &quot;&lt;p&gt;&lt;a href='http://{$details-&gt;domain}{$details-&gt;path}'&gt;{$details-&gt;blogname}&lt;/a&gt; &quot;;
</span><span class="cx">                                                 echo &quot;&lt;select name='blog[$val][{$key}]'&gt;&quot;;
</span><span class="cx">                                                 $out = '';
</span><del>-                                                foreach( $blog_users as $user ) {
</del><ins>+                                                foreach ( $blog_users as $user ) {
</ins><span class="cx">                                                         if ( $user-&gt;user_id != $val )
</span><span class="cx">                                                                 $out .= &quot;&lt;option value='{$user-&gt;user_id}'&gt;{$user-&gt;user_login}&lt;/option&gt;&quot;;
</span><span class="cx">                                                 }
</span><span class="lines">@@ -264,9 +282,8 @@
</span><span class="cx">                 if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
</span><span class="cx">                         $user-&gt;ID = $current_user-&gt;ID;
</span><span class="cx">                         $user-&gt;user_email = wp_specialchars( trim( $new_email[ 'newemail' ] ) );
</span><del>-                        if ( $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT user_login FROM {$wpdb-&gt;signups} WHERE user_login = %s&quot;, $current_user-&gt;user_login ) ) ) {
</del><ins>+                        if ( $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT user_login FROM {$wpdb-&gt;signups} WHERE user_login = %s&quot;, $current_user-&gt;user_login ) ) )
</ins><span class="cx">                                 $wpdb-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE {$wpdb-&gt;signups} SET user_email = %s WHERE user_login = %s&quot;, $user-&gt;user_email, $current_user-&gt;user_login ) );
</span><del>-                        }
</del><span class="cx">                         wp_update_user( get_object_vars( $user ) );
</span><span class="cx">                         delete_option( $current_user-&gt;ID . '_new_email' );
</span><span class="cx">                         wp_redirect( add_query_arg( array('updated' =&gt; 'true'), admin_url( 'profile.php' ) ) );
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12825 => 12826)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-25 21:33:49 UTC (rev 12825)
+++ trunk/wp-includes/ms-functions.php        2010-01-25 22:01:43 UTC (rev 12826)
</span><span class="lines">@@ -1608,13 +1608,13 @@
</span><span class="cx"> 
</span><span class="cx">         $user_id = 0;
</span><span class="cx">         if ( is_email( $string ) ) {
</span><del>-                $user = get_user_by_email($string);
</del><ins>+                $user = get_user_by('email', $string);
</ins><span class="cx">                 if ( $user )
</span><span class="cx">                         $user_id = $user-&gt;ID;
</span><span class="cx">         } elseif ( is_numeric( $string ) ) {
</span><span class="cx">                 $user_id = $string;
</span><span class="cx">         } else {
</span><del>-                $user = get_userdatabylogin($string);
</del><ins>+                $user = get_user_by('login', $string);
</ins><span class="cx">                 if ( $user )
</span><span class="cx">                         $user_id = $user-&gt;ID;
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>