diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 9975158c74..7e078d92aa 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1508,6 +1508,15 @@ function wp_update_comment($commentarr) { if ( empty( $comment ) ) return 0; + $filter_comment = false; + if ( ! has_filter( 'pre_comment_content', 'wp_filter_kses' ) ) { + $filter_comment = ! user_can( isset( $comment['user_id'] ) ? $comment['user_id'] : 0, 'unfiltered_html' ); + } + + if ( $filter_comment ) { + add_filter( 'pre_comment_content', 'wp_filter_kses' ); + } + // Escape data pulled from DB. $comment = wp_slash($comment); @@ -1518,6 +1527,10 @@ function wp_update_comment($commentarr) { $commentarr = wp_filter_comment( $commentarr ); + if ( $filter_comment ) { + remove_filter( 'pre_comment_content', 'wp_filter_kses' ); + } + // Now extract the merged array. extract(wp_unslash($commentarr), EXTR_SKIP); diff --git a/wp-includes/default-widgets.php b/wp-includes/default-widgets.php index 8074a07b7d..a8bad1aff5 100644 --- a/wp-includes/default-widgets.php +++ b/wp-includes/default-widgets.php @@ -834,7 +834,7 @@ function wp_widget_rss_output( $rss, $args = array() ) { if ( is_wp_error($rss) ) { if ( is_admin() || current_user_can('manage_options') ) - echo '

' . sprintf( __('RSS Error: %s'), $rss->get_error_message() ) . '

'; + echo '

' . sprintf( __('RSS Error: %s'), esc_html( $rss->get_error_message() ) ) . '

'; return; } @@ -942,7 +942,7 @@ function wp_widget_rss_form( $args, $inputs = null ) { $show_date = (int) $show_date; if ( !empty($error) ) - echo '

' . sprintf( __('RSS Error: %s'), $error) . '

'; + echo '

' . sprintf( __('RSS Error: %s'), esc_html( $error ) ) . '

'; if ( $inputs['url'] ) : ?> diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 7b30fa4ad1..3e9603b1f5 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2221,8 +2221,16 @@ function wp_nonce_ays( $action ) { $html .= sprintf( __( "Do you really want to log out?"), wp_logout_url() ); } else { $html = __( 'Are you sure you want to do this?' ); - if ( wp_get_referer() ) - $html .= "

" . __( 'Please try again.' ) . ""; + if ( wp_get_referer() ) { + $wp_http_referer = remove_query_arg( 'updated', wp_get_referer() ); + $wp_http_referer = wp_validate_redirect( esc_url_raw( $wp_http_referer ) ); + $html .= '

'; + $html .= sprintf( + '%s', + esc_url( $wp_http_referer ), + __( 'Please try again.' ) + ); + } } wp_die( $html, $title, array('response' => 403) ); diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index 6e8cd9a3c3..25f37788d0 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -313,6 +313,8 @@ function wp_mail( $to, $subject, $message, $headers = '', $attachments = array() $phpmailer->ClearCCs(); $phpmailer->ClearCustomHeaders(); $phpmailer->ClearReplyTos(); + $phpmailer->Body = ''; + $phpmailer->AltBody = ''; // From email and name // If we don't have a name from the input headers diff --git a/wp-mail.php b/wp-mail.php index f1a12c5761..9d271b4fa4 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -56,6 +56,9 @@ if( 0 === $count ) { wp_die( __('There doesn’t seem to be any new mail.') ); } +// Always run as an unauthenticated user. +wp_set_current_user( 0 ); + for ( $i = 1; $i <= $count; $i++ ) { $message = $pop3->get($i); @@ -119,7 +122,6 @@ for ( $i = 1; $i <= $count; $i++ ) { $author = trim($line); $author = sanitize_email($author); if ( is_email($author) ) { - echo '

' . sprintf(__('Author is %s'), $author) . '

'; $userdata = get_user_by('email', $author); if ( ! empty( $userdata ) ) { $post_author = $userdata->ID; diff --git a/wp-trackback.php b/wp-trackback.php index a93bab7c0e..e6a86b2ea2 100644 --- a/wp-trackback.php +++ b/wp-trackback.php @@ -13,6 +13,9 @@ if (empty($wp)) { wp( array( 'tb' => '1' ) ); } +// Always run as an unauthenticated user. +wp_set_current_user( 0 ); + /** * Response to a trackback. *