Index: wp-login.php =================================================================== --- wp-login.php (.../2.1) (revision 5900) +++ wp-login.php (.../2.1.3) (revision 5900) @@ -286,7 +286,7 @@ $user_pass = ''; $using_cookie = FALSE; - if ( !isset( $_REQUEST['redirect_to'] ) ) + if ( !isset( $_REQUEST['redirect_to'] ) || is_user_logged_in() ) $redirect_to = 'wp-admin/'; else $redirect_to = $_REQUEST['redirect_to']; Index: wp-comments-post.php =================================================================== --- wp-comments-post.php (.../2.1) (revision 5900) +++ wp-comments-post.php (.../2.1.3) (revision 5900) @@ -25,14 +25,20 @@ // If the user is logged in $user = wp_get_current_user(); -if ( $user->ID ) : +if ( $user->ID ) { $comment_author = $wpdb->escape($user->display_name); $comment_author_email = $wpdb->escape($user->user_email); $comment_author_url = $wpdb->escape($user->user_url); -else : + if ( current_user_can('unfiltered_html') ) { + if ( wp_create_nonce('unfiltered-html-comment_' . $comment_post_ID) != $_POST['_wp_unfiltered_html_comment'] ) { + kses_remove_filters(); // start with a clean slate + kses_init_filters(); // set up the filters + } + } +} else { if ( get_option('comment_registration') ) wp_die( __('Sorry, you must be logged in to post a comment.') ); -endif; +} $comment_type = ''; Index: wp-includes/default-filters.php =================================================================== --- wp-includes/default-filters.php (.../2.1) (revision 5900) +++ wp-includes/default-filters.php (.../2.1.3) (revision 5900) @@ -31,6 +31,8 @@ add_filter('pre_comment_author_email', 'wp_filter_kses'); add_filter('pre_comment_author_url', 'wp_filter_kses'); +add_action('comment_form', 'wp_comment_form_unfiltered_html_nonce'); + // Default filters for these functions add_filter('comment_author', 'wptexturize'); add_filter('comment_author', 'convert_chars'); Index: wp-includes/post-template.php =================================================================== --- wp-includes/post-template.php (.../2.1) (revision 5900) +++ wp-includes/post-template.php (.../2.1.3) (revision 5900) @@ -273,6 +273,7 @@ $r = array_merge($defaults, $r); $output = ''; + $current_page = 0; // sanitize, mostly to keep spaces out $r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']); @@ -288,7 +289,8 @@ $output .= '