WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/14/2008 05:00:37 PM (13 years ago)
Author:
ryan
Message:

Notice fixes. Props DD32. see #7509

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/users.php

    r7998 r8646  
    99$parent_file = 'users.php';
    1010
    11 $action = $_REQUEST['action'];
     11$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
    1212$update = '';
    1313
     
    2626} else {
    2727    $redirect = 'users.php';
     28    $referer = '';
    2829}
    2930
     
    193194    include('admin-header.php');
    194195
     196    $usersearch = isset($_GET['usersearch']) ? $_GET['usersearch'] : null;
     197    $userspage = isset($_GET['userspage']) ? $_GET['userspage'] : null;
     198    $role = isset($_GET['role']) ? $_GET['role'] : null;
     199   
    195200    // Query the users
    196     $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage'], $_GET['role']);
     201    $wp_user_search = new WP_User_Search($usersearch, $userspage, $role);
    197202
    198203    if ( isset($_GET['update']) ) :
     
    201206        case 'del_many':
    202207        ?>
    203             <?php $delete_count = (int) $_GET['delete_count']; ?>
     208            <?php $delete_count = isset($_GET['delete_count']) ? (int) $_GET['delete_count'] : 0; ?>
    204209            <div id="message" class="updated fade"><p><?php printf(__ngettext('%s user deleted', '%s users deleted', $delete_count), $delete_count); ?></p></div>
    205210        <?php
     
    230235    endif; ?>
    231236
    232 <?php if ( is_wp_error( $errors ) ) : ?>
     237<?php if ( isset($errors) && is_wp_error( $errors ) ) : ?>
    233238    <div class="error">
    234239        <ul>
     
    266271
    267272$current_role = false;
    268 $class = empty($_GET['role']) ? ' class="current"' : '';
     273$class = empty($role) ? ' class="current"' : '';
    269274$role_links[] = "<li><a href=\"users.php\"$class>" . __('All Users') . "</a>";
    270 foreach ( $wp_roles->get_names() as $role => $name ) {
     275foreach ( $wp_roles->get_names() as $this_role => $name ) {
    271276    if ( !isset($avail_roles[$role]) )
    272277        continue;
     
    274279    $class = '';
    275280
    276     if ( $role == $_GET['role'] ) {
    277         $current_role = $_GET['role'];
     281    if ( $this_role == $role ) {
     282        $current_role = $role;
    278283        $class = ' class="current"';
    279284    }
    280285
    281286    $name = translate_with_context($name);
    282     $name = sprintf(_c('%1$s (%2$s)|user role with count'), $name, $avail_roles[$role]);
    283     $role_links[] = "<li><a href=\"users.php?role=$role\"$class>" . $name . '</a>';
     287    $name = sprintf(_c('%1$s (%2$s)|user role with count'), $name, $avail_roles[$this_role]);
     288    $role_links[] = "<li><a href=\"users.php?role=$this_role\"$class>" . $name . '</a>';
    284289}
    285290echo implode(' |</li>', $role_links) . '</li>';
     
    370375
    371376<?php
    372     if ( is_wp_error($add_user_errors) ) {
    373         foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) {
    374             $var = 'new_' . $var;
    375             $$var = attribute_escape(stripslashes($_REQUEST[$formpost]));
    376         }
    377         unset($name);
    378     }
     377    foreach ( array('user_login' => 'user_login', 'first_name' => 'user_firstname', 'last_name' => 'user_lastname', 'email' => 'user_email', 'url' => 'user_uri', 'role' => 'user_role') as $formpost => $var ) {
     378        $var = 'new_' . $var;
     379        $$var = isset($_REQUEST[$formpost]) ? attribute_escape(stripslashes($_REQUEST[$formpost])) : '';
     380    }
     381    unset($name);
    379382?>
    380383
     
    385388<h2 id="add-new-user"><?php _e('Add New User') ?></h2>
    386389
    387 <?php if ( is_wp_error( $add_user_errors ) ) : ?>
     390<?php if ( isset($add_user_errors) && is_wp_error( $add_user_errors ) ) : ?>
    388391    <div class="error">
    389392        <?php
Note: See TracChangeset for help on using the changeset viewer.