Make WordPress Core

Changeset 9596


Ignore:
Timestamp:
11/10/2008 06:54:18 PM (18 years ago)
Author:
ryan
Message:

Notice fixes from DD32. see #7509

Location:
trunk
Files:
16 edited

Legend:

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

    r9586 r9596  
    7878        $blog_name = ' ';
    7979$title_class = '';
    80 if ( function_exists('mb_strlen') && mb_strlen($blog_name, 'UTF-8') > 30 )
    81         $title_class = 'class="long-title"';
     80if ( function_exists('mb_strlen') ) {
     81        if ( mb_strlen($blog_name, 'UTF-8') > 30 )
     82                $title_class = 'class="long-title"';
     83} else {
     84        if ( strlen($blog_name) > 30 )
     85                $title_class = 'class="long-title"';
     86}
    8287?>
    8388
  • trunk/wp-admin/edit-tags.php

    r9589 r9596  
    248248
    249249<?php if ( $can_manage ) {
    250         do_action('add_tag_form_pre', $tag); ?>
     250        do_action('add_tag_form_pre'); ?>
    251251
    252252<div class="form-wrap">
     
    255255<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
    256256<input type="hidden" name="action" value="addtag" />
    257 <input type="hidden" name="tag_ID" value="<?php echo $tag->term_id ?>" />
    258257<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
    259258
    260259<div class="form-field form-required">
    261260        <label for="name"><?php _e('Tag name') ?></label>
    262         <input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
     261        <input name="name" id="name" type="text" value="" size="40" aria-required="true" />
    263262    <p><?php _e('The name is how the tag appears on your site.'); ?></p>
    264263</div>
     
    266265<div class="form-field">
    267266        <label for="slug"><?php _e('Tag slug') ?></label>
    268         <input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
     267        <input name="slug" id="slug" type="text" value="" size="40" />
    269268    <p><?php _e('The &#8220;slug&#8221; is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
    270269</div>
    271270
    272271<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
    273 <?php do_action('edit_tag_form', $tag); ?>
     272<?php do_action('add_tag_form'); ?>
    274273</form></div>
    275274<?php } ?>
  • trunk/wp-admin/includes/dashboard.php

    r9576 r9596  
    3838                        'link' => apply_filters( 'dashboard_incoming_links_link', 'http://blogsearch.google.com/blogsearch?hl=en&scoring=d&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    3939                        'url' => apply_filters( 'dashboard_incoming_links_feed', 'http://blogsearch.google.com/blogsearch_feeds?hl=en&scoring=d&ie=utf-8&num=10&output=rss&partner=wordpress&q=link:' . trailingslashit( get_option('home') ) ),
    40                         'items' => $widget_options['dashboard_incoming_links']['items'],
    41                         'show_date' => $widget_options['dashboard_incoming_links']['show_date']
     40                        'items' => isset($widget_options['dashboard_incoming_links']['items']) ? $widget_options['dashboard_incoming_links']['items'] : 10,
     41                        'show_date' => isset($widget_options['dashboard_incoming_links']['show_date']) ? $widget_options['dashboard_incoming_links']['show_date'] : false
    4242                );
    4343        }
  • trunk/wp-admin/includes/post.php

    r9570 r9596  
    2626        if ( $update )
    2727                $post_data['ID'] = (int) $post_data['post_ID'];
    28         $post_data['post_content'] = $post_data['content'];
    29         $post_data['post_excerpt'] = $post_data['excerpt'];
     28        $post_data['post_content'] = isset($post_data['content']) ? $post_data['content'] : '';
     29        $post_data['post_excerpt'] = isset($post_data['excerpt']) ? $post_data['excerpt'] : '';
    3030        $post_data['post_parent'] = isset($post_data['parent_id'])? $post_data['parent_id'] : '';
    3131        if ( isset($post_data['trackback_url']) )
     
    7272                $post_data['post_status'] = 'pending';
    7373
    74         $previous_status = get_post_field('post_status',  $post_data['ID']);
     74        $previous_status = get_post_field('post_status',  isset($post_data['ID']) ? $post_data['ID'] : $post_data['temp_ID']);
    7575
    7676        // Posts 'submitted for approval' present are submitted to $_POST the same as if they were being published.
  • trunk/wp-admin/includes/template.php

    r9578 r9596  
    31673167        <div class="metabox-prefs">
    31683168<?php
    3169         if ( !meta_box_prefs($screen) ) {
     3169        if ( !meta_box_prefs($screen) && isset($column_screens[$screen]) ) {
    31703170                manage_columns_prefs($column_screens[$screen]);
    31713171                wp_nonce_field( 'hiddencolumns', 'hiddencolumnsnonce', false );
  • trunk/wp-admin/install.php

    r8645 r9596  
    9090                display_header();
    9191                // Fill in the data we gathered
    92                 $weblog_title = stripslashes($_POST['weblog_title']);
    93                 $admin_email = stripslashes($_POST['admin_email']);
    94                 $public = (int) $_POST['blog_public'];
     92                $weblog_title = isset($_POST['weblog_title']) ? stripslashes($_POST['weblog_title']) : '';
     93                $admin_email = isset($_POST['admin_email']) ? stripslashes($_POST['admin_email']) : '';
     94                $public = isset($_POST['blog_public']) ? (int) $_POST['blog_public'] : 0;
    9595                // check e-mail address
    9696                if (empty($admin_email)) {
  • trunk/wp-admin/page.php

    r9509 r9596  
    3535                $location = 'sidebar.php?a=b';
    3636        } elseif ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    37                 if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
     37                if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/page-new.php') === false )
    3838                        $location = add_query_arg( array(
    3939                                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
     
    4242                else
    4343                        $location = add_query_arg( 'message', 4, get_edit_post_link( $page_ID, 'url' ) );
    44         } elseif ($_POST['addmeta']) {
     44        } elseif ( isset($_POST['addmeta']) ) {
    4545                $location = add_query_arg( 'message', 2, wp_get_referer() );
    4646                $location = explode('#', $location);
    4747                $location = $location[0] . '#postcustom';
    48         } elseif ($_POST['deletemeta']) {
     48        } elseif ( isset($_POST['deletemeta']) ) {
    4949                $location = add_query_arg( 'message', 3, wp_get_referer() );
    5050                $location = explode('#', $location);
  • trunk/wp-admin/post.php

    r9509 r9596  
    4040                        $location = 'sidebar.php?a=b';
    4141        } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    42                 if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
     42                if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    4343                        $location = add_query_arg( array(
    4444                                '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
  • trunk/wp-includes/comment.php

    r9541 r9596  
    13931393                if ( !in_array($link_test, $pung) && (url_to_postid($link_test) != $post_ID) // If we haven't pung it already and it isn't a link to itself
    13941394                                && !is_local_attachment($link_test) ) : // Also, let's never ping local attachments.
    1395                         $test = parse_url($link_test);
    1396                         if ( isset($test['query']) )
    1397                                 $post_links[] = $link_test;
    1398                         elseif ( ($test['path'] != '/') && ($test['path'] != '') )
    1399                                 $post_links[] = $link_test;
     1395                        if ( $test = @parse_url($link_test) ) {
     1396                                if ( isset($test['query']) )
     1397                                        $post_links[] = $link_test;
     1398                                elseif ( ($test['path'] != '/') && ($test['path'] != '') )
     1399                                        $post_links[] = $link_test;
     1400                        }
    14001401                endif;
    14011402        endforeach;
  • trunk/wp-includes/js/autosave.js

    r9473 r9596  
    180180        if ( jQuery("#post_author").size() )
    181181                post_data["post_author"] = jQuery("#post_author").val();
     182        post_data["user_ID"] = jQuery("#user-id").val();
    182183
    183184        // Don't run while the TinyMCE spellcheck is on.  Why?  Who knows.
  • trunk/wp-includes/post.php

    r9509 r9596  
    13361336                $post_category = array(get_option('default_category'));
    13371337        }
     1338
     1339        //Set the default tag list
     1340        if ( !isset($tags_input) )
     1341                $tags_input = array();
    13381342
    13391343        if ( empty($post_author) )
  • trunk/wp-includes/query.php

    r9509 r9596  
    16921692                                $where .= " AND ($wpdb->posts.ID = '$reqpage')";
    16931693                                $reqpage_obj = get_page($reqpage);
    1694                                 if ( 'attachment' == $reqpage_obj->post_type ) {
     1694                                if ( is_object($reqpage_obj) && 'attachment' == $reqpage_obj->post_type ) {
    16951695                                        $this->is_attachment = true;
    16961696                                        $this->is_page = true;
  • trunk/wp-includes/script-loader.php

    r9578 r9596  
    7676        ) );
    7777
    78         $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20081102' );
     78        $scripts->add( 'autosave', '/wp-includes/js/autosave.js', array('schedule', 'wp-ajax-response'), '20081110' );
    7979
    8080        $scripts->add( 'wp-lists', '/wp-includes/js/wp-lists.js', array('wp-ajax-response'), '20080729' );
  • trunk/wp-includes/taxonomy.php

    r9481 r9596  
    841841                $do_object = true;
    842842
     843        $term_id = $do_object ? $term->term_id : (isset($term['term_id']) ? $term['term_id'] : 0);
     844
    843845        foreach ( (array) $fields as $field ) {
    844                 if ( $do_object )
    845                         $term->$field = sanitize_term_field($field, $term->$field, $term->term_id, $taxonomy, $context);
    846                 else
    847                         $term[$field] = sanitize_term_field($field, $term[$field], $term['term_id'], $taxonomy, $context);
     846                if ( $do_object ) {
     847                        if ( isset($term->$field) )
     848                                $term->$field = sanitize_term_field($field, $term->$field, $term_id, $taxonomy, $context);
     849                } else {
     850                        if ( isset($term[$field]) )
     851                                $term[$field] = sanitize_term_field($field, $term[$field], $term_id, $taxonomy, $context);
     852                }
    848853        }
    849854
  • trunk/wp-includes/widgets.php

    r9522 r9596  
    17081708 */
    17091709function wp_widget_rss_form( $args, $inputs = null ) {
     1710
    17101711        $default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true );
    17111712        $inputs = wp_parse_args( $inputs, $default_inputs );
    17121713        extract( $args );
     1714        extract( $inputs, EXTR_SKIP);
     1715
    17131716        $number = attribute_escape( $number );
    17141717        $title  = attribute_escape( $title );
  • trunk/wp-settings.php

    r9243 r9596  
    337337        define( 'PLUGINDIR', 'wp-content/plugins' ); // Relative to ABSPATH.  For back compat.
    338338
    339 if ( ! defined('WP_INSTALLING') ) {
    340         // Used to guarantee unique hash cookies
    341         $cookiehash = md5(get_option('siteurl'));
    342         /**
    343          * Used to guarantee unique hash cookies
    344          * @since 1.5
    345          */
    346         define('COOKIEHASH', $cookiehash);
    347 }
     339/**
     340 * Used to guarantee unique hash cookies
     341 * @since 1.5
     342 */
     343define('COOKIEHASH', md5(get_option('siteurl')));
    348344
    349345/**
Note: See TracChangeset for help on using the changeset viewer.