Make WordPress Core

Changeset 8646


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

Notice fixes. Props DD32. see #7509

Location:
trunk
Files:
12 edited

Legend:

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

    r8484 r8646  
    5757    if ( isset($_GET['post_status']) && in_array( $_GET['post_status'], array_keys($post_stati) ) )
    5858        $post_status_label = $post_stati[$_GET['post_status']][1];
    59     if ( $post_listing_pageable && !is_archive() && !is_search() )
    60         $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
    61     else
     59    //if ( $post_listing_pageable && !is_archive() && !is_search() ) //Unreachable code: $post_listing_pageable is undefined, Similar code in upload.php
     60    //  $h2_noun = is_paged() ? sprintf(__( 'Previous %s' ), $post_status_label) : sprintf(__('Latest %s'), $post_status_label);
     61    //else
    6262        $h2_noun = $post_status_label;
    6363    // Use $_GET instead of is_ since they can override each other
    6464    $h2_author = '';
    65     $_GET['author'] = (int) $_GET['author'];
     65    $_GET['author'] = isset($_GET['author']) ? (int) $_GET['author'] : 0;
    6666    if ( $_GET['author'] != 0 ) {
    6767        if ( $_GET['author'] == '-' . $user_ID ) { // author exclusion
     
    9494    if ( empty( $num_posts->$status ) )
    9595        continue;
    96     if ( $status == $_GET['post_status'] )
     96    if ( isset($_GET['post_status']) && $status == $_GET['post_status'] )
    9797        $class = ' class="current"';
    9898
     
    147147$month_count = count($arc_result);
    148148
    149 if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) { ?>
     149if ( $month_count && !( 1 == $month_count && 0 == $arc_result[0]->mmonth ) ) {
     150$m = isset($_GET['m']) ? (int)$_GET['m'] : 0;
     151?>
    150152<select name='m'>
    151 <option<?php selected( @$_GET['m'], 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
     153<option<?php selected( $m, 0 ); ?> value='0'><?php _e('Show all dates'); ?></option>
    152154<?php
    153155foreach ($arc_result as $arc_row) {
     
    156158    $arc_row->mmonth = zeroise( $arc_row->mmonth, 2 );
    157159
    158     if ( $arc_row->yyear . $arc_row->mmonth == $_GET['m'] )
     160    if ( $arc_row->yyear . $arc_row->mmonth == $m )
    159161        $default = ' selected="selected"';
    160162    else
  • trunk/wp-admin/includes/post.php

    r8600 r8646  
    491491    if ( false === $q )
    492492        $q = $_GET;
    493     $q['m']   = (int) $q['m'];
    494     $q['cat'] = (int) $q['cat'];
     493    $q['m']   = isset($q['m']) ? (int) $q['m'] : 0;
     494    $q['cat'] = isset($q['cat']) ? (int) $q['cat'] : 0;
    495495    $post_stati  = array(   //  array( adj, noun )
    496496                'publish' => array(__('Published'), __('Published posts'), __ngettext_noop('Published (%s)', 'Published (%s)')),
     
    511511    }
    512512
    513     if ( 'pending' === $q['post_status'] ) {
     513    if ( isset($q['post_status']) && 'pending' === $q['post_status'] ) {
    514514        $order = 'ASC';
    515515        $orderby = 'modified';
    516     } elseif ( 'draft' === $q['post_status'] ) {
     516    } elseif ( isset($q['post_status']) && 'draft' === $q['post_status'] ) {
    517517        $order = 'DESC';
    518518        $orderby = 'modified';
  • trunk/wp-admin/includes/template.php

    r8600 r8646  
    344344    $posts_columns = array();
    345345    $posts_columns['cb'] = '<input type="checkbox" />';
    346     if ( 'draft' === $_GET['post_status'] )
     346    if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] )
    347347        $posts_columns['modified'] = __('Modified');
    348     elseif ( 'pending' === $_GET['post_status'] )
     348    elseif ( isset($_GET['post_status']) && 'pending' === $_GET['post_status'] )
    349349        $posts_columns['modified'] = __('Submitted');
    350350    else
     
    354354    $posts_columns['categories'] = __('Categories');
    355355    $posts_columns['tags'] = __('Tags');
    356     if ( !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
     356    if ( !isset($_GET['post_status']) || !in_array($_GET['post_status'], array('pending', 'draft', 'future')) )
    357357        $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>';
    358358    $posts_columns['status'] = __('Status');
     
    10931093function wp_dropdown_roles( $default = false ) {
    10941094    global $wp_roles;
     1095    $p = '';
    10951096    $r = '';
    10961097    foreach( $wp_roles->role_names as $role => $name ) {
  • trunk/wp-admin/includes/theme.php

    r8589 r8646  
    4545
    4646            if ( !empty( $name ) ) {
    47                 $page_templates[trim( $name )] = basename( $template );
     47                $page_templates[trim( $name )] = theme_basename( $template );
    4848            }
    4949        }
  • trunk/wp-admin/includes/user.php

    r8467 r8646  
    302302    var $too_many_total_users = false;
    303303    var $search_errors;
     304    var $paging_text;
    304305
    305306    function WP_User_Search ($search_term = '', $page = '', $role = '') { // constructor
  • trunk/wp-admin/plugins.php

    r8600 r8646  
    1313    $action = $_GET['action'];
    1414
    15 $plugin = $_REQUEST['plugin'];
     15$plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
    1616
    1717if( !empty($action) ) {
  • 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
  • trunk/wp-includes/capabilities.php

    r8573 r8646  
    138138    var $roles = array();
    139139    var $allcaps = array();
     140   
     141    var $first_name = '';
     142    var $last_name = '';
    140143
    141144    function WP_User( $id, $name = '' ) {
  • trunk/wp-includes/classes.php

    r8600 r8646  
    111111
    112112                    // Substitute the substring matches into the query.
    113                     eval("\$query = \"" . addslashes($query) . "\";");
     113                    eval("@\$query = \"" . addslashes($query) . "\";");
     114                   
    114115                    $this->matched_query = $query;
    115116
  • trunk/wp-includes/post.php

    r8637 r8646  
    19361936    $leaf_path  = sanitize_title(basename($page_paths));
    19371937    $page_paths = explode('/', $page_paths);
     1938    $full_path = '';
    19381939    foreach( (array) $page_paths as $pathdir)
    19391940        $full_path .= ($pathdir!=''?'/':'') . sanitize_title($pathdir);
  • trunk/wp-includes/query.php

    r8637 r8646  
    687687                $this->is_tax = false;
    688688                foreach ( $GLOBALS['wp_taxonomies'] as $t ) {
    689                     if ( isset($t->query_var) && '' != $qv[$t->query_var] ) {
     689                    if ( isset($t->query_var) && isset($qv[$t->query_var]) && '' != $qv[$t->query_var] ) {
    690690                        $this->is_tax = true;
    691691                        break;
  • trunk/wp-includes/taxonomy.php

    r8600 r8646  
    298298    global $wpdb;
    299299
    300     if ( empty($term) )
    301         return null;
    302 
    303     if ( ! is_taxonomy($taxonomy) )
    304         return new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
     300    if ( empty($term) ) {
     301        $error = new WP_Error('invalid_term', __('Empty Term'));
     302        return $error;
     303    }
     304
     305    if ( ! is_taxonomy($taxonomy) ) {
     306        $error = new WP_Error('invalid_taxonomy', __('Invalid Taxonomy'));
     307        return $error;
     308    }
    305309
    306310    if ( is_object($term) ) {
Note: See TracChangeset for help on using the changeset viewer.