<!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>[12800] trunk: Fix warnings</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Fix warnings</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.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="trunkwpadminmssitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-sites.php (12799 => 12800)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-22 21:46:35 UTC (rev 12799)
+++ trunk/wp-admin/ms-sites.php        2010-01-22 22:14:22 UTC (rev 12800)
</span><span class="lines">@@ -315,7 +315,7 @@
</span><span class="cx">         default:
</span><span class="cx">                 $apage = ( isset($_GET['apage'] ) &amp;&amp; intval( $_GET['apage'] ) ) ? absint( $_GET['apage'] ) : 1;
</span><span class="cx">                 $num = ( isset($_GET['num'] ) &amp;&amp; intval( $_GET['num'] ) ) ? absint( $_GET['num'] ) : 15;
</span><del>-                $s = wp_specialchars( trim( $_GET[ 's' ] ) );
</del><ins>+                $s = isset($_GET['s']) ? esc_attr( trim( $_GET[ 's' ] ) ) : '';
</ins><span class="cx">                 $like_s = like_escape($s);
</span><span class="cx"> 
</span><span class="cx">                 $query = &quot;SELECT * FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' &quot;;
</span><span class="lines">@@ -332,38 +332,38 @@
</span><span class="cx">                                 AND {$wpdb-&gt;registration_log}.IP LIKE ('%{$like_s}%')&quot;;
</span><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                if ( isset( $_GET['sortby'] ) == false ) {
-                        $_GET['sortby'] = 'id';
-                }
</del><ins>+                $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
</ins><span class="cx"> 
</span><del>-                if ( $_GET['sortby'] == 'registered' ) {
</del><ins>+                if ( $order_by == 'registered' ) {
</ins><span class="cx">                         $query .= ' ORDER BY registered ';
</span><del>-                } elseif ( $_GET['sortby'] == 'id' ) {
-                        $query .= ' ORDER BY ' . $wpdb-&gt;blogs . '.blog_id ';
-                } elseif ( $_GET['sortby'] == 'lastupdated' ) {
</del><ins>+                } elseif ( $order_by == 'lastupdated' ) {
</ins><span class="cx">                         $query .= ' ORDER BY last_updated ';
</span><del>-                } elseif ( $_GET['sortby'] == 'blogname' ) {
</del><ins>+                } elseif ( $order_by == 'blogname' ) {
</ins><span class="cx">                         $query .= ' ORDER BY domain ';
</span><ins>+                } else {
+                        $order_by = 'id';
+                        $query .= ' ORDER BY ' . $wpdb-&gt;blogs . '.blog_id ';
</ins><span class="cx">                 }
</span><span class="cx"> 
</span><del>-                $query .= ( $_GET['order'] == 'DESC' ) ? 'DESC' : 'ASC';
</del><ins>+                $order = isset($_GET['order']) ? $_GET['order'] : 'ASC';
+                $order = ( 'DESC' == $order ) ? 'DESC' : 'ASC';
+                $query .= $order;
</ins><span class="cx"> 
</span><del>-                if ( !empty($s) ) {
</del><ins>+                if ( !empty($s) )
</ins><span class="cx">                         $total = $wpdb-&gt;get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $total = $wpdb-&gt;get_var( &quot;SELECT COUNT(blog_id) FROM {$wpdb-&gt;blogs} WHERE site_id = '{$wpdb-&gt;siteid}' &quot;);
</span><del>-                }
</del><span class="cx"> 
</span><span class="cx">                 $query .= &quot; LIMIT &quot; . intval( ( $apage - 1 ) * $num) . &quot;, &quot; . intval( $num );
</span><span class="cx">                 $blog_list = $wpdb-&gt;get_results( $query, ARRAY_A );
</span><span class="cx"> 
</span><span class="cx">                 // Pagination
</span><del>-                $url2 = &quot;&amp;amp;order=&quot; . $_GET['order'] . &quot;&amp;amp;sortby=&quot; . $_GET['sortby'] . &quot;&amp;amp;s=&quot;;
-                if ( $_GET[ 'blog_ip' ] ) {
</del><ins>+                $url2 = &quot;&amp;amp;order=&quot; . $order . &quot;&amp;amp;sortby=&quot; . $order_by . &quot;&amp;amp;s=&quot;;
+                if ( !empty($_GET[ 'blog_ip' ])  )
</ins><span class="cx">                         $url2 .= &quot;&amp;amp;ip_address=&quot; . urlencode( $s );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $url2 .= $s . &quot;&amp;amp;ip_address=&quot; . urlencode( $s );
</span><del>-                }
</del><ins>+
</ins><span class="cx">                 $blog_navigation = paginate_links( array(
</span><span class="cx">                         'base' =&gt; add_query_arg( 'apage', '%#%' ).$url2,
</span><span class="cx">                         'format' =&gt; '',
</span><span class="lines">@@ -421,11 +421,10 @@
</span><span class="cx">                 $posts_columns = apply_filters('wpmu_blogs_columns', $posts_columns);
</span><span class="cx"> 
</span><span class="cx">                 $sortby_url = &quot;s=&quot;;
</span><del>-                if ( $_GET[ 'blog_ip' ] ) {
</del><ins>+                if ( !empty($_GET[ 'blog_ip' ]) )
</ins><span class="cx">                         $sortby_url .= &quot;&amp;ip_address=&quot; . urlencode( $s );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $sortby_url .= urlencode( $s ) . &quot;&amp;ip_address=&quot; . urlencode( $s );
</span><del>-                }
</del><span class="cx">                 ?&gt;
</span><span class="cx"> 
</span><span class="cx">                 &lt;table width=&quot;100%&quot; cellpadding=&quot;3&quot; cellspacing=&quot;3&quot; class=&quot;widefat&quot;&gt;
</span><span class="lines">@@ -434,8 +433,8 @@
</span><span class="cx">                                 &lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;/th&gt;
</span><span class="cx">                                 &lt;?php foreach($posts_columns as $column_id =&gt; $column_display_name) {
</span><span class="cx">                                         $column_link = &quot;&lt;a href='ms-sites.php?{$sortby_url}&amp;amp;sortby={$column_id}&amp;amp;&quot;;
</span><del>-                                        if ( $_GET['sortby'] == $column_id ) {
-                                                $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;amp;' : 'order=DESC&amp;amp;';
</del><ins>+                                        if ( $order_by == $column_id ) {
+                                                $column_link .= ($order_by == 'DESC') ? 'order=ASC&amp;amp;' : 'order=DESC&amp;amp;';
</ins><span class="cx">                                         }
</span><span class="cx">                                         $column_link .= &quot;apage={$apage}'&gt;{$column_display_name}&lt;/a&gt;&quot;;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpincludesmsfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/ms-functions.php (12799 => 12800)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/ms-functions.php        2010-01-22 21:46:35 UTC (rev 12799)
+++ trunk/wp-includes/ms-functions.php        2010-01-22 22:14:22 UTC (rev 12800)
</span><span class="lines">@@ -1,7 +1,10 @@
</span><span class="cx"> &lt;?php
</span><del>-/*
-        Helper functions for WPMU
-*/
</del><ins>+/**
+ * Multi-site WordPress API
+ *
+ * @package WordPress
+ */
+
</ins><span class="cx"> function load_muplugin_textdomain($domain, $path = false) {
</span><span class="cx">         $locale = get_locale();
</span><span class="cx">         if ( empty($locale) )
</span><span class="lines">@@ -125,11 +128,13 @@
</span><span class="cx">         if ( !is_numeric( $id ) )
</span><span class="cx">                 $id = get_id_from_blogname( $id );
</span><span class="cx"> 
</span><ins>+        $id = (int) $id;
+
</ins><span class="cx">         $all = $getall == true ? '' : 'short';
</span><span class="cx">         $details = wp_cache_get( $id . $all, 'blog-details' );
</span><span class="cx"> 
</span><span class="cx">         if ( $details ) {
</span><del>-                if ( $details == -1 )
</del><ins>+                if ( !is_object($details) &amp;&amp; $details == -1 )
</ins><span class="cx">                         return false;
</span><span class="cx">                 elseif ( !is_object($details) ) // Clear old pre-serialized objects. Cache clients do better with that.
</span><span class="cx">                         wp_cache_delete( $id . $all, 'blog-details' );
</span></span></pre>
</div>
</div>

</body>
</html>