WordPress.org

Make WordPress Core

Changeset 11052


Ignore:
Timestamp:
04/22/2009 12:24:45 PM (9 years ago)
Author:
azaozz
Message:

Notice fixes, props sivel, see #9393

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r11040 r11052  
    1212 * @since unknown
    1313 */
    14 define('WP_ADMIN', TRUE);
     14if ( !defined('WP_ADMIN') )
     15    define('WP_ADMIN', TRUE);
    1516
    1617if ( defined('ABSPATH') )
  • trunk/wp-admin/includes/media.php

    r11051 r11052  
    397397            $errors[$attachment_id] = $post['errors'];
    398398            unset($post['errors']);
     399        } else {
     400            $errors = array();
    399401        }
    400402
     
    430432    }
    431433
    432     return $errors;
     434    return isset($errors) ? $errors : '';
    433435}
    434436
     
    988990            'input'      => 'html',
    989991            'html'       => "<input type='text' class='urlfield' readonly='readonly' name='attachments[$post->ID][url]' value='" . attribute_escape($image_url) . "' /><br />",
    990             'value'      => $edit_post->post_url,
     992            'value'      => isset($edit_post->post_url) ? $edit_post->post_url : '',
    991993            'helps'      => __('Location of the uploaded file.'),
    992994        )
     
    12231225        $item .= "\t<input type='hidden' name='$name' id='$name' value='" . attribute_escape( $value ) . "' />\n";
    12241226
    1225     if ( $post->post_parent < 1 && (int) $_REQUEST['post_id'] ) {
     1227    if ( $post->post_parent < 1 && isset($_REQUEST['post_id']) ) {
    12261228        $parent = (int) $_REQUEST['post_id'];
    12271229        $parent_name = "attachments[$attachment_id][post_parent]";
     
    17011703<input type="hidden" name="tab" value="<?php echo attribute_escape( $tab ); ?>" />
    17021704<input type="hidden" name="post_id" value="<?php echo (int) $post_id; ?>" />
    1703 <input type="hidden" name="post_mime_type" value="<?php echo attribute_escape( $_GET['post_mime_type'] ); ?>" />
     1705<input type="hidden" name="post_mime_type" value="<?php echo isset( $_GET['post_mime_type'] ) ? attribute_escape( $_GET['post_mime_type'] ) : ''; ?>" />
    17041706
    17051707<p id="media-search" class="search-box">
     
    17161718foreach ( $matches as $_type => $reals )
    17171719    foreach ( $reals as $real )
    1718         $num_posts[$_type] += $_num_posts[$real];
     1720        if ( isset($num_posts[$_type]) )
     1721            $num_posts[$_type] += $_num_posts[$real];
     1722        else
     1723            $num_posts[$_type] = $_num_posts[$real];
    17191724// If available type specified by media button clicked, filter by that type
    17201725if ( empty($_GET['post_mime_type']) && !empty($num_posts[$type]) ) {
     
    17241729if ( empty($_GET['post_mime_type']) || $_GET['post_mime_type'] == 'all' )
    17251730    $class = ' class="current"';
     1731else
     1732    $class = '';
    17261733$type_links[] = "<li><a href='" . clean_url(add_query_arg(array('post_mime_type'=>'all', 'paged'=>false, 'm'=>false))) . "'$class>".__('All Types')."</a>";
    17271734foreach ( $post_mime_types as $mime_type => $label ) {
     
    17311738        continue;
    17321739
    1733     if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
     1740    if ( isset($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) )
    17341741        $class = ' class="current"';
    17351742
  • trunk/wp-admin/media.php

    r10137 r11052  
    9595<p class="submit">
    9696<input type="submit" class="button-primary" name="save" value="<?php _e('Update Media'); ?>" />
    97 <input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
     97<input type="hidden" name="post_id" id="post_id" value="<?php echo isset($post_id) ? $post_id : ''; ?>" />
    9898<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo $att_id; ?>" />
    9999<input type="hidden" name="action" value="editattachment" />
Note: See TracChangeset for help on using the changeset viewer.