From 2fdde1e7363f3646a35783930124544689e7b3dc Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 4 Nov 2008 03:22:24 +0000 Subject: [PATCH] Notice fixes from filosofo and Viper007Bond. see #7509 git-svn-id: http://svn.automattic.com/wordpress/trunk@9506 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/categories.php | 12 ++++++------ wp-admin/edit-attachment-rows.php | 2 +- wp-admin/edit-form-advanced.php | 2 +- wp-admin/edit-link-categories.php | 4 ++-- wp-admin/edit-link-form.php | 8 +++++--- wp-admin/edit-page-form.php | 2 +- wp-admin/import/blogger.php | 2 +- wp-admin/includes/plugin-install.php | 1 - wp-admin/includes/template.php | 2 +- wp-admin/link.php | 10 +++++----- wp-admin/options.php | 4 +++- wp-admin/upload.php | 4 ++-- wp-admin/user-edit.php | 2 +- wp-includes/canonical.php | 4 ++++ wp-includes/category.php | 6 ++++-- wp-includes/rewrite.php | 8 ++++++-- wp-includes/widgets.php | 2 ++ 17 files changed, 45 insertions(+), 30 deletions(-) diff --git a/wp-admin/categories.php b/wp-admin/categories.php index e5fdd50364..bda2b260ce 100644 --- a/wp-admin/categories.php +++ b/wp-admin/categories.php @@ -230,8 +230,13 @@ if ( $page_links )
-
+ +
+

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>

+

category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

+
+ @@ -278,11 +283,6 @@ if ( $page_links ) -
-

Note:
Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category %s.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?>

-

category to tag converter.'), 'admin.php?import=wp-cat2tag') ?>

-
- diff --git a/wp-admin/edit-attachment-rows.php b/wp-admin/edit-attachment-rows.php index ff4ca863ff..a71b6a45e2 100644 --- a/wp-admin/edit-attachment-rows.php +++ b/wp-admin/edit-attachment-rows.php @@ -128,7 +128,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) { } else { $t_time = get_the_time(__('Y/m/d g:i:s A')); $m_time = $post->post_date; - $time = get_post_time( 'G', true ); + $time = get_post_time( 'G', true, $post ); if ( ( abs($t_diff = time() - $time) ) < 86400 ) { if ( $t_diff < 0 ) $h_time = sprintf( __('%s from now'), human_time_diff( $time ) ); diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index 849d95c126..4b5adcb6e1 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -204,7 +204,7 @@ if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?> post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> - post_date_gmt . ' +0000' ) ) : ?> + post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> diff --git a/wp-admin/edit-link-categories.php b/wp-admin/edit-link-categories.php index f435cfaa41..7875959d4e 100644 --- a/wp-admin/edit-link-categories.php +++ b/wp-admin/edit-link-categories.php @@ -180,7 +180,7 @@ if ( $page_links )
-parent = 0; do_action('add_link_category_form_pre', $category); ?>
@@ -198,7 +198,7 @@ if ( $page_links )
-

+

diff --git a/wp-admin/edit-link-form.php b/wp-admin/edit-link-form.php index d2413d0eee..0e63f0939a 100644 --- a/wp-admin/edit-link-form.php +++ b/wp-admin/edit-link-form.php @@ -70,7 +70,7 @@ function link_submit_meta_box($link) { link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . js_escape( sprintf( __("You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete link') . ""; ?>

@@ -341,8 +341,10 @@ add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link'
--> ID) ) { ?> post_status, array('publish', 'future') ) || 0 == $post->ID ) { ?> - post_date_gmt . ' +0000' ) ) : ?> + post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?> diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index 6164c17756..dc45e6ec8a 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -814,7 +814,7 @@ class Blogger_Import { echo $result->get_error_message(); } elseif ( isset($_GET['token']) ) $this->auth(); - elseif ( $this->token && $this->token_is_valid() ) + elseif ( isset($this->token) && $this->token_is_valid() ) $this->show_blogs(); else $this->greet(); diff --git a/wp-admin/includes/plugin-install.php b/wp-admin/includes/plugin-install.php index f25167cb3e..b809d276ad 100644 --- a/wp-admin/includes/plugin-install.php +++ b/wp-admin/includes/plugin-install.php @@ -173,7 +173,6 @@ function install_search_form(){ - post_date; - $time = get_post_time('G', true); + $time = get_post_time('G', true, $post); if ( ( abs(time() - $time) ) < 86400 ) { if ( ( 'future' == $post->post_status) ) diff --git a/wp-admin/link.php b/wp-admin/link.php index a384cdb8a7..b123bc6d5f 100644 --- a/wp-admin/link.php +++ b/wp-admin/link.php @@ -17,12 +17,12 @@ wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description if ( ! current_user_can('manage_links') ) wp_die( __('You do not have sufficient permissions to edit the links for this blog.') ); -if ('' != $_POST['deletebookmarks']) +if ( !empty($_POST['deletebookmarks']) ) $action = 'deletebookmarks'; -if ('' != $_POST['move']) +if ( !empty($_POST['move']) ) $action = 'move'; -if ('' != $_POST['linkcheck']) - $linkcheck = $_POST[linkcheck]; +if ( !empty($_POST['linkcheck']) ) + $linkcheck = $_POST['linkcheck']; $this_file = 'link-manager.php'; @@ -114,4 +114,4 @@ switch ($action) { default : break; } -?> \ No newline at end of file +?> diff --git a/wp-admin/options.php b/wp-admin/options.php index a651df4bc5..d95cf045a5 100644 --- a/wp-admin/options.php +++ b/wp-admin/options.php @@ -70,7 +70,9 @@ case 'update': if ( $options ) { foreach ( $options as $option ) { $option = trim($option); - $value = $_POST[$option]; + $value = null; + if ( isset($_POST[$option]) ) + $value = $_POST[$option]; if ( !is_array($value) ) $value = trim($value); $value = stripslashes_deep($value); update_option($option, $value); diff --git a/wp-admin/upload.php b/wp-admin/upload.php index e1efbf738b..9b257eee1c 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -184,7 +184,7 @@ $_num_posts = (array) wp_count_attachments(); $matches = wp_match_mime_types(array_keys($post_mime_types), array_keys($_num_posts)); foreach ( $matches as $type => $reals ) foreach ( $reals as $real ) - $num_posts[$type] += $_num_posts[$real]; + $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real]; $class = empty($_GET['post_mime_type']) && ! isset($_GET['detached']) ? ' class="current"' : ''; $type_links[] = "
  • ".__('All Types').""; @@ -194,7 +194,7 @@ foreach ( $post_mime_types as $mime_type => $label ) { if ( !wp_match_mime_types($mime_type, $avail_post_mime_types) ) continue; - if ( wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) + if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) $class = ' class="current"'; $type_links[] = "
  • " . diff --git a/wp-admin/user-edit.php b/wp-admin/user-edit.php index ebded2341a..2c946a1b8d 100644 --- a/wp-admin/user-edit.php +++ b/wp-admin/user-edit.php @@ -222,7 +222,7 @@ foreach ( $_wp_admin_css_colors as $color => $color_info ): ?> -' ); ?> + $wp_query->post_count && ($id = get_query_var('p')) ) { $vars = $wpdb->get_results( $wpdb->prepare("SELECT post_type, post_parent FROM $wpdb->posts WHERE ID = %d", $id) ); diff --git a/wp-includes/category.php b/wp-includes/category.php index 1d0bd24253..dc51606c5e 100644 --- a/wp-includes/category.php +++ b/wp-includes/category.php @@ -277,8 +277,10 @@ function sanitize_category_field( $field, $value, $cat_id, $context ) { function &get_tags( $args = '' ) { $tags = get_terms( 'post_tag', $args ); - if ( empty( $tags ) ) - return array(); + if ( empty( $tags ) ) { + $return = array(); + return $return; + } $tags = apply_filters( 'get_tags', $tags, $args ); return $tags; diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index c5c5c50d23..8fa51a5f13 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -1626,10 +1626,14 @@ class WP_Rewrite { } $site_root = parse_url(get_option('siteurl')); - $site_root = trailingslashit($site_root['path']); + if ( isset( $site_root['path'] ) ) { + $site_root = trailingslashit($site_root['path']); + } $home_root = parse_url(get_option('home')); - $home_root = trailingslashit($home_root['path']); + if ( isset( $home_root['path'] ) ) { + $home_root = trailingslashit($home_root['path']); + } $rules = "\n"; $rules .= "RewriteEngine On\n"; diff --git a/wp-includes/widgets.php b/wp-includes/widgets.php index 3d4d074867..191057c6a1 100644 --- a/wp-includes/widgets.php +++ b/wp-includes/widgets.php @@ -1551,6 +1551,8 @@ function wp_widget_rss_output( $rss, $args = array() ) { return; } + $default_args = array( 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0 ); + $args = wp_parse_args( $args, $default_args ); extract( $args, EXTR_SKIP ); $items = (int) $items;