<!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>[12801] trunk/wp-admin: Fix warnings.</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Fix warnings. see <a href="http://trac.wordpress.org/ticket/11644">#11644</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminmssitesphp">trunk/wp-admin/ms-sites.php</a></li>
<li><a href="#trunkwpadminmsusersphp">trunk/wp-admin/ms-users.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 (12800 => 12801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-sites.php        2010-01-22 22:14:22 UTC (rev 12800)
+++ trunk/wp-admin/ms-sites.php        2010-01-22 22:27:26 UTC (rev 12801)
</span><span class="lines">@@ -378,7 +378,7 @@
</span><span class="cx"> 
</span><span class="cx">                 &lt;form action=&quot;ms-sites.php&quot; method=&quot;get&quot; id=&quot;ms-search&quot;&gt;
</span><span class="cx">                         &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;blogs&quot; /&gt;
</span><del>-                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s ) ); ?&gt;&quot; size=&quot;17&quot; /&gt;
</del><ins>+                        &lt;input type=&quot;text&quot; name=&quot;s&quot; value=&quot;&lt;?php echo($s); ?&gt;&quot; size=&quot;17&quot; /&gt;
</ins><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_name&quot; value=&quot;&lt;?php esc_attr_e('Search blogs by name') ?&gt;&quot; /&gt;
</span><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_id&quot; value=&quot;&lt;?php esc_attr_e('by blog ID') ?&gt;&quot; /&gt;
</span><span class="cx">                         &lt;input type=&quot;submit&quot; class=&quot;button&quot; name=&quot;blog_ip&quot; value=&quot;&lt;?php esc_attr_e('by IP address') ?&gt;&quot; /&gt;
</span></span></pre></div>
<a id="trunkwpadminmsusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/ms-users.php (12800 => 12801)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/ms-users.php        2010-01-22 22:14:22 UTC (rev 12800)
+++ trunk/wp-admin/ms-users.php        2010-01-22 22:27:26 UTC (rev 12801)
</span><span class="lines">@@ -14,7 +14,7 @@
</span><span class="cx"> if ( !is_super_admin() )
</span><span class="cx">         wp_die( __('You do not have permission to access this page.') );
</span><span class="cx"> 
</span><del>-if ( $_GET['updated'] == 'true' ) {
</del><ins>+if ( isset($_GET['updated']) &amp;&amp; $_GET['updated'] == 'true' ) {
</ins><span class="cx">         ?&gt;
</span><span class="cx">         &lt;div id=&quot;message&quot; class=&quot;updated fade&quot;&gt;&lt;p&gt;
</span><span class="cx">                 &lt;?php
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         &lt;?php
</span><span class="cx">         $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1;
</span><span class="cx">         $num = isset( $_GET['num'] ) ? intval( $_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"> 
</span><span class="cx">         $query = &quot;SELECT * FROM {$wpdb-&gt;users}&quot;;
</span><span class="cx"> 
</span><span class="lines">@@ -54,21 +54,24 @@
</span><span class="cx">                 $query .= &quot; WHERE user_login LIKE '$search' OR user_email LIKE '$search'&quot;;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if ( !isset($_GET['sortby']) )
-                $_GET['sortby'] = 'id';
</del><ins>+        $order_by = isset( $_GET['sortby'] ) ? $_GET['sortby'] : 'id';
</ins><span class="cx"> 
</span><del>-        if ( $_GET['sortby'] == 'email' )
</del><ins>+        if ( $order_by == 'email' ) {
</ins><span class="cx">                 $query .= ' ORDER BY user_email ';
</span><del>-        elseif ( $_GET['sortby'] == 'id' )
-                $query .= ' ORDER BY ID ';
-        elseif ( $_GET['sortby'] == 'login' )
</del><ins>+        } elseif ( $order_by == 'login' ) {
</ins><span class="cx">                 $query .= ' ORDER BY user_login ';
</span><del>-        elseif ( $_GET['sortby'] == 'name' )
</del><ins>+        } elseif ( $order_by == 'name' ) {
</ins><span class="cx">                 $query .= ' ORDER BY display_name ';
</span><del>-        elseif ( $_GET['sortby'] == 'registered' )
</del><ins>+        } elseif ( $order_by == 'registered' ) {
</ins><span class="cx">                 $query .= ' ORDER BY user_registered ';
</span><ins>+        } else {
+                $order_by = 'id';
+                $query .= ' ORDER BY ID ';
+        }
</ins><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><span class="cx">         if ( !empty( $s ) )
</span><span class="cx">                 $total = $wpdb-&gt;get_var( str_replace('SELECT *', 'SELECT COUNT(ID)', $query) );
</span><span class="lines">@@ -146,7 +149,7 @@
</span><span class="cx">                                         } elseif ( $column_id == 'checkbox') {
</span><span class="cx">                                                 echo '&lt;th scope=&quot;col&quot; class=&quot;check-column&quot;&gt;&lt;input type=&quot;checkbox&quot; /&gt;&lt;/th&gt;';
</span><span class="cx">                                         } else { ?&gt;
</span><del>-                                                &lt;th scope=&quot;col&quot;&gt;&lt;a href=&quot;ms-users.php?sortby=&lt;?php echo $column_id ?&gt;&amp;amp;&lt;?php if ( $_GET['sortby'] == $column_id ) { if ( $_GET['order'] == 'DESC' ) { echo &quot;order=ASC&amp;amp;&quot; ; } else { echo &quot;order=DESC&amp;amp;&quot;; } } ?&gt;apage=&lt;?php echo $apage ?&gt;&quot;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/a&gt;&lt;/th&gt;
</del><ins>+                                                &lt;th scope=&quot;col&quot;&gt;&lt;a href=&quot;ms-users.php?sortby=&lt;?php echo $column_id ?&gt;&amp;amp;&lt;?php if ( $order_by == $column_id ) { if ( $order == 'DESC' ) { echo &quot;order=ASC&amp;amp;&quot; ; } else { echo &quot;order=DESC&amp;amp;&quot;; } } ?&gt;apage=&lt;?php echo $apage ?&gt;&quot;&gt;&lt;?php echo $column_display_name; ?&gt;&lt;/a&gt;&lt;/th&gt;
</ins><span class="cx">                                         &lt;?php } ?&gt;
</span><span class="cx">                                 &lt;?php } ?&gt;
</span><span class="cx">                         &lt;/tr&gt;
</span><span class="lines">@@ -154,6 +157,7 @@
</span><span class="cx">                         &lt;tbody id=&quot;users&quot; class=&quot;list:user user-list&quot;&gt;
</span><span class="cx">                         &lt;?php if ($user_list) {
</span><span class="cx">                                 $bgcolor = '';
</span><ins>+                                $class = '';
</ins><span class="cx">                                 foreach ( (array) $user_list as $user) {
</span><span class="cx">                                         $class = ('alternate' == $class) ? '' : 'alternate';
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>