<!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">                 <form action="ms-sites.php" method="get" id="ms-search">
</span><span class="cx">                         <input type="hidden" name="action" value="blogs" />
</span><del>-                        <input type="text" name="s" value="<?php if (isset($_GET['s'])) echo stripslashes( esc_attr( $s ) ); ?>" size="17" />
</del><ins>+                        <input type="text" name="s" value="<?php echo($s); ?>" size="17" />
</ins><span class="cx">                         <input type="submit" class="button" name="blog_name" value="<?php esc_attr_e('Search blogs by name') ?>" />
</span><span class="cx">                         <input type="submit" class="button" name="blog_id" value="<?php esc_attr_e('by blog ID') ?>" />
</span><span class="cx">                         <input type="submit" class="button" name="blog_ip" value="<?php esc_attr_e('by IP address') ?>" />
</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']) && $_GET['updated'] == 'true' ) {
</ins><span class="cx">         ?>
</span><span class="cx">         <div id="message" class="updated fade"><p>
</span><span class="cx">                 <?php
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx">         <?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 = "SELECT * FROM {$wpdb->users}";
</span><span class="cx">
</span><span class="lines">@@ -54,21 +54,24 @@
</span><span class="cx">                 $query .= " WHERE user_login LIKE '$search' OR user_email LIKE '$search'";
</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->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 '<th scope="col" class="check-column"><input type="checkbox" /></th>';
</span><span class="cx">                                         } else { ?>
</span><del>-                                                <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&amp;<?php if ( $_GET['sortby'] == $column_id ) { if ( $_GET['order'] == 'DESC' ) { echo "order=ASC&amp;" ; } else { echo "order=DESC&amp;"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>
</del><ins>+                                                <th scope="col"><a href="ms-users.php?sortby=<?php echo $column_id ?>&amp;<?php if ( $order_by == $column_id ) { if ( $order == 'DESC' ) { echo "order=ASC&amp;" ; } else { echo "order=DESC&amp;"; } } ?>apage=<?php echo $apage ?>"><?php echo $column_display_name; ?></a></th>
</ins><span class="cx">                                         <?php } ?>
</span><span class="cx">                                 <?php } ?>
</span><span class="cx">                         </tr>
</span><span class="lines">@@ -154,6 +157,7 @@
</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><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>