<!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'] ) && intval( $_GET['apage'] ) ) ? absint( $_GET['apage'] ) : 1;
</span><span class="cx">                 $num = ( isset($_GET['num'] ) && 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 = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ";
</span><span class="lines">@@ -332,38 +332,38 @@
</span><span class="cx">                                 AND {$wpdb->registration_log}.IP LIKE ('%{$like_s}%')";
</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->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->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->get_var( str_replace('SELECT *', 'SELECT COUNT(blog_id)', $query) );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $total = $wpdb->get_var( "SELECT COUNT(blog_id) FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' ");
</span><del>-                }
</del><span class="cx">
</span><span class="cx">                 $query .= " LIMIT " . intval( ( $apage - 1 ) * $num) . ", " . intval( $num );
</span><span class="cx">                 $blog_list = $wpdb->get_results( $query, ARRAY_A );
</span><span class="cx">
</span><span class="cx">                 // Pagination
</span><del>-                $url2 = "&amp;order=" . $_GET['order'] . "&amp;sortby=" . $_GET['sortby'] . "&amp;s=";
-                if ( $_GET[ 'blog_ip' ] ) {
</del><ins>+                $url2 = "&amp;order=" . $order . "&amp;sortby=" . $order_by . "&amp;s=";
+                if ( !empty($_GET[ 'blog_ip' ]) )
</ins><span class="cx">                         $url2 .= "&amp;ip_address=" . urlencode( $s );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $url2 .= $s . "&amp;ip_address=" . urlencode( $s );
</span><del>-                }
</del><ins>+
</ins><span class="cx">                 $blog_navigation = paginate_links( array(
</span><span class="cx">                         'base' => add_query_arg( 'apage', '%#%' ).$url2,
</span><span class="cx">                         'format' => '',
</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 = "s=";
</span><del>-                if ( $_GET[ 'blog_ip' ] ) {
</del><ins>+                if ( !empty($_GET[ 'blog_ip' ]) )
</ins><span class="cx">                         $sortby_url .= "&ip_address=" . urlencode( $s );
</span><del>-                } else {
</del><ins>+                else
</ins><span class="cx">                         $sortby_url .= urlencode( $s ) . "&ip_address=" . urlencode( $s );
</span><del>-                }
</del><span class="cx">                 ?>
</span><span class="cx">
</span><span class="cx">                 <table width="100%" cellpadding="3" cellspacing="3" class="widefat">
</span><span class="lines">@@ -434,8 +433,8 @@
</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-sites.php?{$sortby_url}&amp;sortby={$column_id}&amp;";
</span><del>-                                        if ( $_GET['sortby'] == $column_id ) {
-                                                $column_link .= $_GET[ 'order' ] == 'DESC' ? 'order=ASC&amp;' : 'order=DESC&amp;';
</del><ins>+                                        if ( $order_by == $column_id ) {
+                                                $column_link .= ($order_by == 'DESC') ? 'order=ASC&amp;' : 'order=DESC&amp;';
</ins><span class="cx">                                         }
</span><span class="cx">                                         $column_link .= "apage={$apage}'>{$column_display_name}</a>";
</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"> <?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) && $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>