WordPress.org

Make WordPress Core

Ticket #5607: remaining_notices.diff

File remaining_notices.diff, 29.8 KB (added by westi, 7 years ago)

Merged patch for wp-admin remaining notices

  • wp-admin/edit-category-form.php

     
    55        $form = '<form name="editcat" id="editcat" method="post" action="categories.php">'; 
    66        $action = 'editedcat'; 
    77        $nonce_action = 'update-category_' . $cat_ID; 
    8         do_action('edit_category_form_pre', $category); 
     8        do_action('edit_category_form_pre', ( isset($category) ) ? $category : null); 
    99} else { 
    1010        $heading = __('Add Category'); 
    1111        $submit_text = __('Add Category &raquo;'); 
    1212        $form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list:">'; 
    1313        $action = 'addcat'; 
    1414        $nonce_action = 'add-category'; 
    15         do_action('add_category_form_pre', $category); 
     15        do_action('add_category_form_pre', ( isset($category) ) ? $category : null); 
    1616} 
    1717?> 
    1818 
     
    2020<h2><?php echo $heading ?></h2> 
    2121<div id="ajax-response"></div> 
    2222<?php echo $form ?> 
    23 <input type="hidden" name="action" value="<?php echo $action ?>" /> 
    24 <input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" /> 
     23<input type="hidden" name="action" value="<?php echo ( isset($action) ) ? $action : '' ?>" /> 
     24<input type="hidden" name="cat_ID" value="<?php echo ( isset($category->term_id) ) ? $category->term_id : ''?>" /> 
    2525<?php wp_nonce_field($nonce_action); ?> 
    2626        <table class="editform" width="100%" cellspacing="2" cellpadding="5"> 
    2727                <tr class="form-field form-required"> 
    2828                        <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th> 
    29                         <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" /></td> 
     29                        <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo ( isset($category->name) ) ? attribute_escape($category->name) : ''; ?>" size="40" /></td> 
    3030                </tr> 
    3131                <tr class="form-field"> 
    3232                        <th scope="row" valign="top"><label for="category_nicename"><?php _e('Category slug:') ?></label></th> 
    33                         <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape($category->slug); ?>" size="40" /></td> 
     33                        <td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo ( isset($category->attribute_escape) ) ? attribute_escape($category->slug) : ''; ?>" size="40" /></td> 
    3434                </tr> 
    3535                <tr class="form-field"> 
    3636                        <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th> 
    3737                        <td> 
    38                                 <?php wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $category->parent . '&hierarchical=1&show_option_none=' . __('None')); ?> 
     38                                <?php $parent = ( isset($category->parent) ) ? $category->parent : ''; 
     39                                wp_dropdown_categories('hide_empty=0&name=category_parent&orderby=name&selected=' . $parent . '&hierarchical=1&show_option_none=' . __('None')); ?> 
    3940                        </td> 
    4041                </tr> 
    4142                <tr class="form-field"> 
    4243                        <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th> 
    43                         <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea></td> 
     44                        <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo ( isset($category->description) ) ? wp_specialchars($category->description) : ''; ?></textarea></td> 
    4445                </tr> 
    4546        </table> 
    4647<p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p> 
    47 <?php do_action('edit_category_form', $category); ?> 
     48<?php do_action('edit_category_form', ( isset($category) ) ? $category : null); ?> 
    4849</form> 
    4950</div> 
  • wp-admin/edit-link-form.php

     
    1414function xfn_check($class, $value = '', $deprecated = '') { 
    1515        global $link; 
    1616 
    17         $link_rel = $link->link_rel; 
     17        $link_rel = ( isset($link->link_rel) ) ? $link->link_rel : null; 
    1818        $rels = preg_split('/\s+/', $link_rel); 
    1919 
    2020        if ('' != $value && in_array($value, $rels) ) { 
     
    5151<h3 class="dbx-handle"><?php _e('Target') ?></h3> 
    5252<div class="dbx-content"> 
    5353<label for="link_target_blank" class="selectit"> 
    54 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> 
     54<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo((isset($link->link_target) && $link->link_target == '_blank') ? 'checked="checked"' : ''); ?> /> 
    5555<code>_blank</code></label> 
    5656<label for="link_target_top" class="selectit"> 
    57 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> /> 
     57<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo((isset($link->link_target) && $link->link_target == '_top') ? 'checked="checked"' : ''); ?> /> 
    5858<code>_top</code></label> 
    5959<label for="link_target_none" class="selectit"> 
    60 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> /> 
     60<input id="link_target_none" type="radio" name="link_target" value="" <?php echo((isset($link->link_target) && $link->link_target == '') ? 'checked="checked"' : ''); ?> /> 
    6161<?php _e('none') ?></label> 
    6262</div> 
    6363</fieldset> 
     
    8484</tr> 
    8585<tr> 
    8686<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th> 
    87 <td width="80%"><input type="text" name="link_url" id="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td> 
     87<td width="80%"><input type="text" name="link_url" id="link_url" value="<?php echo ( empty( $link->link_url ) ) ? 'http://' : $link->link_url; ?>" style="width: 95%" /></td> 
    8888</tr> 
    8989<tr> 
    9090<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th> 
    91 <td><input type="text" name="link_description" id="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td> 
     91<td><input type="text" name="link_description" id="link_description" value="<?php echo ( ! empty( $link->link_description ) ) ? $link->link_description : ''; ?>" style="width: 95%" /></td> 
    9292</tr> 
    9393</table> 
    9494 
     
    104104<table class="editform" width="100%" cellspacing="2" cellpadding="5"> 
    105105        <tr> 
    106106                <th width="20%" scope="row"><?php _e('rel:') ?></th> 
    107                 <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td> 
     107                <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( ! empty($link->link_rel) ) ? $link->link_rel : ''; ?>" /></td> 
    108108        </tr> 
    109109        <tr> 
    110110                <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th> 
     
    217217<table class="editform" width="100%" cellspacing="2" cellpadding="5"> 
    218218        <tr> 
    219219                <th width="20%" scope="row"><?php _e('Image Address:') ?></th> 
    220                 <td width="80%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td> 
     220                <td width="80%"><input type="text" name="link_image" size="50" value="<?php echo ( isset($link->link_image) ) ? $link->link_image : ''; ?>" style="width: 95%" /></td> 
    221221        </tr> 
    222222        <tr> 
    223223                <th scope="row"><?php _e('RSS Address:') ?> </th> 
    224                 <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td> 
     224                <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo ( isset($link->link_rss) ) ? $link->link_rss : ''; ?>" size="50" style="width: 95%" /></td> 
    225225        </tr> 
    226226        <tr> 
    227227                <th scope="row"><?php _e('Notes:') ?></th> 
    228                 <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td> 
     228                <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset($link->link_notes) ) ? $link->link_notes : ''; ?></textarea></td> 
    229229        </tr> 
    230230        <tr> 
    231231                <th scope="row"><?php _e('Rating:') ?></th> 
     
    233233                <?php 
    234234                        for ($r = 0; $r < 10; $r++) { 
    235235                                echo('            <option value="'.$r.'" '); 
    236                                 if ($link->link_rating == $r) 
     236                                if (isset($link->link_rating) && $link->link_rating == $r) 
    237237                                        echo 'selected="selected"'; 
    238238                                echo('>'.$r.'</option>'); 
    239239                        } 
  • wp-admin/edit-page-form.php

     
    33<h2 id="write-post"><?php _e('Write Page'); ?></h2> 
    44<?php 
    55 
    6 if (0 == $post_ID) { 
     6if (empty($post_ID) || 0 == $post_ID) { 
    77        $form_action = 'post'; 
    88        $nonce_action = 'add-page'; 
    99        $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() 
     
    2020 
    2121$sendto = clean_url(stripslashes(wp_get_referer())); 
    2222 
    23 if ( 0 != $post_ID && $sendto == get_permalink($post_ID) ) 
     23if ( ! empty($post_ID) && $sendto == get_permalink($post_ID) ) 
    2424        $sendto = 'redo'; 
    2525?> 
    2626 
     
    7373 
    7474<fieldset id="passworddiv" class="dbx-box"> 
    7575<h3 class="dbx-handle"><?php _e('Page Password') ?></h3> 
    76 <div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></div> 
     76<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo ( isset($post->post_password) ) ? attribute_escape( $post->post_password ) : ''; ?>" /></div> 
    7777</fieldset> 
    7878 
    7979<fieldset id="pageparent" class="dbx-box"> 
     
    9898 
    9999<fieldset id="slugdiv" class="dbx-box"> 
    100100<h3 class="dbx-handle"><?php _e('Page Slug') ?></h3> 
    101 <div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /></div> 
     101<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( ( isset($post->post_name) ) ? $post->post_name : '' ); ?>" /></div> 
    102102</fieldset> 
    103103 
    104104<?php if ( $authors = get_editable_authors( $current_user->id ) ) : // TODO: ROLE SYSTEM ?> 
  • wp-admin/edit-pages.php

     
    4141 
    4242<form name="searchform" id="searchform" action="" method="get"> 
    4343        <fieldset><legend><?php _e('Search Terms&hellip;') ?></legend> 
    44                 <input type="text" name="s" id="s" value="<?php echo attribute_escape( stripslashes( $_GET['s'] ) ); ?>" size="17" /> 
     44                <input type="text" name="s" id="s" value="<?php echo ( isset($_GET['s']) ) ? attribute_escape( stripslashes( $_GET['s'] ) ) : ''; ?>" size="17" /> 
    4545        </fieldset> 
    4646 
    4747 
  • wp-admin/edit.php

     
    44$title = __('Posts'); 
    55$parent_file = 'edit.php'; 
    66wp_enqueue_script( 'admin-posts' ); 
    7 if ( 1 == $_GET['c'] ) 
     7if ( isset($_GET['c']) && 1 == $_GET['c'] ) 
    88        wp_enqueue_script( 'admin-comments' ); 
    99require_once('admin-header.php'); 
    1010 
     
    3131if ( is_single() ) { 
    3232        printf(__('Comments on %s'), apply_filters( "the_title", $post->post_title)); 
    3333} else { 
    34         if ( $post_listing_pageable && !is_archive() && !is_search() ) 
     34        if ( isset($post_listing_pageable) && $post_listing_pageable && !is_archive() && !is_search() ) 
    3535                $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label); 
    3636        else 
    37                 $h2_noun = $post_status_label; 
     37                $h2_noun = ( isset($post_status_label) ) ? $post_status_label : null; 
    3838        // Use $_GET instead of is_ since they can override each other 
    3939        $h2_author = ''; 
    40         $_GET['author'] = (int) $_GET['author']; 
     40        $_GET['author'] = ( isset($_GET['author']) ) ? (int) $_GET['author'] : 0; 
    4141        if ( $_GET['author'] != 0 ) { 
    4242                if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion 
    4343                        $h2_author = ' ' . __('by other authors'); 
     
    111111<?php } ?> 
    112112 
    113113        <fieldset><legend><?php _e('Category&hellip;') ?></legend> 
    114                 <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.$cat);?> 
     114                <?php wp_dropdown_categories('show_option_all='.__('All').'&hide_empty=1&hierarchical=1&show_count=1&selected='.((isset($cat))?$cat:0));?> 
    115115        </fieldset> 
    116116        <input type="submit" id="post-query-submit" value="<?php _e('Filter &#187;'); ?>" class="button" /> 
    117117</form> 
  • wp-admin/includes/plugin.php

     
    1818        $name = $plugin_name[1]; 
    1919        $name = trim( $name ); 
    2020        $plugin = $name; 
    21         if ('' != trim($plugin_uri[1]) && '' != $name ) { 
     21        if (isset($plugin_uri[1]) && '' != trim($plugin_uri[1]) && '' != $name ) { 
    2222                $plugin = '<a href="' . trim( $plugin_uri[1] ) . '" title="'.__( 'Visit plugin homepage' ).'">'.$plugin.'</a>'; 
    2323        } 
    2424 
    25         if ('' == $author_uri[1] ) { 
     25        if (! isset($author_uri[1]) || '' == $author_uri[1] ) { 
    2626                $author = trim( $author_name[1] ); 
    2727        } else { 
    2828                $author = '<a href="' . trim( $author_uri[1] ) . '" title="'.__( 'Visit author homepage' ).'">' . trim( $author_name[1] ) . '</a>'; 
  • wp-admin/includes/post.php

     
    134134                $text       = wp_specialchars( stripslashes( urldecode( $_REQUEST['text'] ) ) ); 
    135135                $text       = funky_javascript_fix( $text); 
    136136                $popupurl   = clean_url($_REQUEST['popupurl']); 
    137         $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 
    138     } 
     137                $post_content = '<a href="'.$popupurl.'">'.$post_title.'</a>'."\n$text"; 
     138        } else 
     139                $post_content = '';      
     140                 
    139141 
    140142        if ( !empty( $_REQUEST['excerpt'] ) ) 
    141143                $post_excerpt = wp_specialchars( stripslashes( $_REQUEST['excerpt'] )); 
     
    478480        global $wpdb; 
    479481        if ( false === $q ) 
    480482                $q = $_GET; 
    481         $q['m']   = (int) $q['m']; 
    482         $q['cat'] = (int) $q['cat']; 
     483        $q['m']   = ( isset($q['m']) ) ? (int) $q['m'] : 0; 
     484        $q['cat'] = ( isset($q['cat']) ) ? (int) $q['cat'] : 0; 
    483485        $post_stati  = array(   //      array( adj, noun ) 
    484486                                'draft' => array(__('Draft'), _c('Drafts|manage posts header')), 
    485487                                'future' => array(__('Scheduled'), __('Scheduled posts')), 
     
    497499                $post_status_q = '&post_status=' . $q['post_status']; 
    498500        } 
    499501 
    500         if ( 'pending' === $q['post_status'] ) { 
     502        if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) { 
    501503                $order = 'ASC'; 
    502504                $orderby = 'modified'; 
    503         } elseif ( 'draft' === $q['post_status'] ) { 
     505        } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) { 
    504506                $order = 'DESC'; 
    505507                $orderby = 'modified'; 
    506508        } else { 
  • wp-admin/includes/template.php

     
    241241function wp_manage_posts_columns() { 
    242242        $posts_columns = array(); 
    243243        $posts_columns['id'] = '<div style="text-align: center">' . __('ID') . '</div>'; 
    244         if ( 'draft' === $_GET['post_status'] ) 
     244        if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] ) 
    245245                $posts_columns['modified'] = __('Modified'); 
    246         elseif ( 'pending' === $_GET['post_status'] ) 
     246        elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] ) 
    247247                $posts_columns['modified'] = __('Submitted'); 
    248248        else 
    249249                $posts_columns['date'] = __('When'); 
    250250        $posts_columns['title'] = __('Title'); 
    251251        $posts_columns['categories'] = __('Categories'); 
    252         if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 
     252        if ( ! isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) ) 
    253253                $posts_columns['comments'] = '<div style="text-align: center">' . __('Comments') . '</div>'; 
    254254        $posts_columns['author'] = __('Author'); 
    255255        $posts_columns = apply_filters('manage_posts_columns', $posts_columns); 
     
    361361        $url = $user_object->user_url; 
    362362        $short_url = str_replace( 'http://', '', $url ); 
    363363        $short_url = str_replace( 'www.', '', $short_url ); 
     364        $first_name = ( isset( $user_object->first_name ) ) ? $user_object->first_name : ''; 
     365        $last_name = ( isset( $user_object->last_name ) ) ? $user_object->last_name : ''; 
    364366        if ('/' == substr( $short_url, -1 )) 
    365367                $short_url = substr( $short_url, 0, -1 ); 
    366368        if ( strlen( $short_url ) > 35 ) 
     
    369371        $r = "<tr id='user-$user_object->ID'$style> 
    370372                <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' class='$role' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td> 
    371373                <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td> 
    372                 <td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td> 
     374                <td><label for='user_{$user_object->ID}'>$first_name $last_name</label></td> 
    373375                <td><a href='mailto:$email' title='" . sprintf( __('e-mail: %s' ), $email ) . "'>$email</a></td> 
    374376                <td><a href='$url' title='website: $url'>$short_url</a></td>"; 
    375377        $r .= "\n\t\t<td align='center'>"; 
     
    587589        global $wp_locale, $post, $comment; 
    588590 
    589591        if ( $for_post ) 
    590                 $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (!$post->post_date || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 
     592                $edit = ( in_array($post->post_status, array('draft', 'pending') ) && (empty($post->post_date) || '0000-00-00 00:00:00' == $post->post_date ) ) ? false : true; 
    591593         
    592594        $tab_index_attribute = ''; 
    593595        if ( (int) $tab_index > 0 ) 
     
    596598        echo '<fieldset><legend><input type="checkbox" class="checkbox" name="edit_date" value="1" id="timestamp"'.$tab_index_attribute.' /> <label for="timestamp">'.__( 'Edit timestamp' ).'</label></legend>'; 
    597599 
    598600        $time_adj = time() + (get_option( 'gmt_offset' ) * 3600 ); 
    599         $post_date = ($for_post) ? $post->post_date : $comment->comment_date; 
     601        $post_date = ( ! empty( $post->post_date ) ) ? $post->post_date : null; 
     602        $comment_date = ( ! empty( $comment->comment_date ) ) ? $comment->comment_date : null; 
     603        $post_date = ($for_post) ? $post_date : $comment_date; 
    600604        $jj = ($edit) ? mysql2date( 'd', $post_date ) : gmdate( 'd', $time_adj ); 
    601605        $mm = ($edit) ? mysql2date( 'm', $post_date ) : gmdate( 'm', $time_adj ); 
    602606        $aa = ($edit) ? mysql2date( 'Y', $post_date ) : gmdate( 'Y', $time_adj ); 
     
    773777 
    774778function wp_remember_old_slug() { 
    775779        global $post; 
    776         $name = attribute_escape($post->post_name); // just in case 
     780        $name = ( ! empty($post->post_name) ) ? attribute_escape($post->post_name) : ''; // just in case 
    777781        if ( strlen($name) ) 
    778782                echo '<input type="hidden" id="wp-old-slug" name="wp-old-slug" value="' . $name . '" />'; 
    779783} 
  • wp-admin/includes/theme.php

     
    3838                        preg_match( '|Template Name:(.*)$|mi', $template_data, $name ); 
    3939                        preg_match( '|Description:(.*)$|mi', $template_data, $description ); 
    4040 
    41                         $name = $name[1]; 
    42                         $description = $description[1]; 
     41                        $name = ( isset($name[1]) ) ? $name[1] : null; 
     42                        $description = ( isset($description[1]) ) ? $description[1] : null; 
    4343 
    4444                        if ( !empty( $name ) ) { 
    4545                                $page_templates[trim( $name )] = basename( $template ); 
  • wp-admin/includes/upload.php

     
    163163<?php   endif; ?> 
    164164                        <tr> 
    165165                                <th scope="row"><label for="post_title"><?php _e('Title'); ?></label></th> 
    166                                 <td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td> 
     166                                <td><input type="text" id="post_title" name="post_title" value="<?php echo ( isset($attachment->post_title) ) ? $attachment->post_title : ''; ?>" /></td> 
    167167                        </tr> 
    168168                        <tr> 
    169169                                <th scope="row"><label for="post_content"><?php _e('Description'); ?></label></th> 
    170                                 <td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td> 
     170                                <td><textarea name="post_content" id="post_content"><?php echo ( isset($attachment->post_conent) ) ? $attachment->post_content : ''; ?></textarea></td> 
    171171                        </tr> 
    172172                        <?php if (isset($attachment_data['image_meta'])) { ?> 
    173173                                <tr> 
  • wp-admin/includes/user.php

     
    217217 
    218218function get_user_to_edit( $user_id ) { 
    219219        $user = new WP_User( $user_id ); 
    220         $user->user_login   = attribute_escape($user->user_login); 
    221         $user->user_email   = attribute_escape($user->user_email); 
    222         $user->user_url     = clean_url($user->user_url); 
    223         $user->first_name   = attribute_escape($user->first_name); 
    224         $user->last_name    = attribute_escape($user->last_name); 
    225         $user->display_name = attribute_escape($user->display_name); 
    226         $user->nickname     = attribute_escape($user->nickname); 
    227         $user->aim          = attribute_escape($user->aim); 
    228         $user->yim          = attribute_escape($user->yim); 
    229         $user->jabber       = attribute_escape($user->jabber); 
    230         $user->description  =  wp_specialchars($user->description); 
     220        $user->user_login   = ( isset($user->user_login) ) ? attribute_escape($user->user_login) : ''; 
     221        $user->user_email   = ( isset($user->user_email) ) ? attribute_escape($user->user_email) : ''; 
     222        $user->user_url     = ( isset($user->user_url) ) ? clean_url($user->user_url) : ''; 
     223        $user->first_name   = ( isset($user->first_name) ) ? attribute_escape($user->first_name) : ''; 
     224        $user->last_name    = ( isset($user->last_name) ) ? attribute_escape($user->last_name) : ''; 
     225        $user->display_name = ( isset($user->display_name) ) ? attribute_escape($user->display_name) : ''; 
     226        $user->nickname     = ( isset($user->nickname) ) ? attribute_escape($user->nickname) : ''; 
     227        $user->aim          = ( isset($user->aim) ) ? attribute_escape($user->aim) : ''; 
     228        $user->yim          = ( isset($user->yim) ) ? attribute_escape($user->yim) : ''; 
     229        $user->jabber       = ( isset($user->jabber) ) ? attribute_escape($user->jabber) : ''; 
     230        $user->description  = ( isset($user->description) ) ? wp_specialchars($user->description) : ''; 
    231231 
    232232        return $user; 
    233233} 
  • wp-admin/includes/widgets.php

     
    146146function wp_widget_control( $key, $widget, $display = 'display' ) { 
    147147        static $i = 0; 
    148148        global $wp_registered_widgets, $wp_registered_widget_controls; 
    149         $control = $wp_registered_widget_controls[$widget]; 
    150         $widget  = $wp_registered_widgets[$widget]; 
     149        $control = (isset($wp_registered_widget_controls[$widget])) ? $wp_registered_widget_controls[$widget] : null; 
     150        $widget  = (isset($wp_registered_widgets[$widget])) ? $wp_registered_widgets[$widget] : null; 
    151151 
    152         $id_format = $widget['id']; 
     152        $id_format = ( isset($widget['id']) ) ? $widget['id'] : null; 
    153153        if ( 'template' == $display && isset($control['params'][0]['number']) ) { 
    154154                // number == -1 implies a template where id numbers are replaced by a generic '%i%' 
    155155                $control['params'][0]['number'] = -1; 
  • wp-admin/link-add.php

     
    1616require('admin-header.php'); 
    1717?> 
    1818 
    19 <?php if ($_GET['added'] && '' != $_POST['link_name']) : ?> 
     19<?php if ( ! empty($_GET['added']) && '' != $_POST['link_name']) : ?> 
    2020<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div> 
    2121<?php endif; ?> 
    2222 
  • wp-admin/link-manager.php

     
    129129                        $short_url = substr($short_url, 0, 32).'...'; 
    130130 
    131131                $visible = ($link->link_visible == 'Y') ? __('Yes') : __('No'); 
    132                 ++ $i; 
     132                if ( isset($i) )  
     133                        ++ $i; 
     134                else 
     135                        $i = 1; 
    133136                $style = ($i % 2) ? '' : ' class="alternate"'; 
    134137                ?><tr id="link-<?php echo $link->link_id; ?>" valign="middle" <?php echo $style; ?>><?php 
    135138                foreach($link_columns as $column_name=>$column_display_name) { 
  • wp-admin/plugin-editor.php

     
    5555        if ( !current_user_can('edit_plugins') ) 
    5656                wp_die('<p>'.__('You do not have sufficient permissions to edit plugins for this blog.').'</p>'); 
    5757 
    58         if ( $_GET['liveupdate'] ) { 
     58        if ( ! empty($_GET['liveupdate']) ) { 
    5959                check_admin_referer('edit-plugin-test_' . $file); 
    6060                $current = get_option('active_plugins'); 
    6161                $plugin = $file; 
  • wp-admin/users.php

     
    88$title = __('Users'); 
    99$parent_file = 'users.php'; 
    1010 
    11 $action = $_REQUEST['action']; 
     11$action = ( isset($_REQUEST['action']) ) ? $_REQUEST['action'] : ''; 
    1212$update = ''; 
    1313 
    1414if ( empty($_POST) ) { 
     
    6161                                $searches[] = $col . " LIKE '%$this->search_term%'"; 
    6262                        $search_sql .= implode(' OR ', $searches); 
    6363                        $search_sql .= ')'; 
     64                } else { 
     65                        $search_sql = ''; 
    6466                } 
    6567                $this->query_from_where = "FROM $wpdb->users WHERE 1=1 $search_sql"; 
    6668 
     
    276278        include('admin-header.php'); 
    277279 
    278280        // Query the users 
    279         $wp_user_search = new WP_User_Search($_GET['usersearch'], $_GET['userspage']); 
    280281 
     282        $usersearch = ( isset($_GET['usersearch']) ) ? $_GET['usersearch'] : null; 
     283        $userspage = ( isset($_GET['userspage']) ) ? $_GET['userspage'] : null; 
     284        $wp_user_search = new WP_User_Search($usersearch, $userspage); 
     285 
    281286        // Make the user objects 
    282287        foreach ( $wp_user_search->get_results() as $userid ) { 
    283288                $tmp_user = new WP_User($userid); 
     
    320325                } 
    321326        endif; ?> 
    322327 
    323 <?php if ( is_wp_error( $errors ) ) : ?> 
     328<?php if ( ! empty($errors) && is_wp_error( $errors ) ) : ?> 
    324329        <div class="error"> 
    325330                <ul> 
    326331                <?php 
     
    429434</div> 
    430435 
    431436<?php 
    432         if ( is_wp_error($add_user_errors) ) { 
     437        if ( ! empty($add_user_errors) && is_wp_error($add_user_errors) ) { 
    433438                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 ) { 
    434439                        $var = 'new_' . $var; 
    435440                        $$var = attribute_escape(stripslashes($_POST[$formpost])); 
     
    441446<div class="wrap"> 
    442447<h2 id="add-new-user"><?php _e('Add New User') ?></h2> 
    443448 
    444 <?php if ( is_wp_error( $add_user_errors ) ) : ?> 
     449<?php if ( ! empty($add_user_errors) && is_wp_error( $add_user_errors ) ) : ?> 
    445450        <div class="error"> 
    446451                <?php 
    447452                        foreach ( $add_user_errors->get_error_messages() as $message ) 
     
    464469<table class="editform" width="100%" cellspacing="2" cellpadding="5"> 
    465470        <tr class="form-field form-required"> 
    466471                <th scope="row" width="33%"><?php _e('Username (required)') ?><input name="action" type="hidden" id="action" value="adduser" /></th> 
    467                 <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo $new_user_login; ?>" /></td> 
     472                <td width="66%"><input name="user_login" type="text" id="user_login" value="<?php echo ( ! empty($new_user_login) ) ? $new_user_login : ''; ?>" /></td> 
    468473        </tr> 
    469474        <tr class="form-field"> 
    470475                <th scope="row"><?php _e('First Name') ?> </th> 
    471                 <td><input name="first_name" type="text" id="first_name" value="<?php echo $new_user_firstname; ?>" /></td> 
     476                <td><input name="first_name" type="text" id="first_name" value="<?php echo ( ! empty($new_user_firstname) ) ? $new_user_firstname : ''; ?>" /></td> 
    472477        </tr> 
    473478        <tr class="form-field"> 
    474479                <th scope="row"><?php _e('Last Name') ?> </th> 
    475                 <td><input name="last_name" type="text" id="last_name" value="<?php echo $new_user_lastname; ?>" /></td> 
     480                <td><input name="last_name" type="text" id="last_name" value="<?php echo ( ! empty($new_user_lastname) ) ? $new_user_lastname : ''; ?>" /></td> 
    476481        </tr> 
    477482        <tr class="form-field form-required"> 
    478483                <th scope="row"><?php _e('E-mail (required)') ?></th> 
    479                 <td><input name="email" type="text" id="email" value="<?php echo $new_user_email; ?>" /></td> 
     484                <td><input name="email" type="text" id="email" value="<?php echo ( ! empty($new_user_email) ) ? $new_user_email : ''; ?>" /></td> 
    480485        </tr> 
    481486        <tr class="form-field"> 
    482487                <th scope="row"><?php _e('Website') ?></th> 
    483                 <td><input name="url" type="text" id="url" value="<?php echo $new_user_uri; ?>" /></td> 
     488                <td><input name="url" type="text" id="url" value="<?php echo ( ! empty($new_user_uri) ) ? $new_user_uri : ''; ?>" /></td> 
    484489        </tr> 
    485490 
    486491<?php if ( apply_filters('show_password_fields', true) ) : ?> 
     
    496501                <th scope="row"><?php _e('Role'); ?></th> 
    497502                <td><select name="role" id="role"> 
    498503                        <?php 
    499                         if ( !$new_user_role ) 
     504                        if ( empty($new_user_role) ) 
    500505                                $new_user_role = get_option('default_role'); 
    501506                        wp_dropdown_roles($new_user_role); 
    502507                        ?>