diff --git a/wp-includes/comment.php b/wp-includes/comment.php index 635cb59f97..fc423ef2ed 100644 --- a/wp-includes/comment.php +++ b/wp-includes/comment.php @@ -1986,6 +1986,15 @@ function wp_update_comment($commentarr) { 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); @@ -1996,6 +2005,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. $data = wp_unslash( $commentarr ); diff --git a/wp-includes/customize/class-wp-customize-header-image-control.php b/wp-includes/customize/class-wp-customize-header-image-control.php index 8bbb572b8f..471333daec 100644 --- a/wp-includes/customize/class-wp-customize-header-image-control.php +++ b/wp-includes/customize/class-wp-customize-header-image-control.php @@ -107,10 +107,10 @@ class WP_Customize_Header_Image_Control extends WP_Customize_Image_Control { <# } #> <# } #> diff --git a/wp-includes/customize/class-wp-customize-site-icon-control.php b/wp-includes/customize/class-wp-customize-site-icon-control.php index 69dea75ed0..a1d655c174 100644 --- a/wp-includes/customize/class-wp-customize-site-icon-control.php +++ b/wp-includes/customize/class-wp-customize-site-icon-control.php @@ -70,7 +70,7 @@ class WP_Customize_Site_Icon_Control extends WP_Customize_Cropped_Image_Control
" . __( '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, __( 'WordPress Failure Notice' ), 403 ); diff --git a/wp-includes/media-template.php b/wp-includes/media-template.php index 8d7c758c50..f18688471b 100644 --- a/wp-includes/media-template.php +++ b/wp-includes/media-template.php @@ -1245,7 +1245,7 @@ function wp_print_media_templates() {
' . sprintf( __('RSS Error: %s'), $rss->get_error_message() ) . '
'; + echo '' . sprintf( __('RSS Error: %s'), esc_html( $rss->get_error_message() ) ) . '
'; return; } @@ -1342,7 +1342,7 @@ function wp_widget_rss_form( $args, $inputs = null ) { $args['show_date'] = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date']; if ( ! empty( $args['error'] ) ) { - echo ' '; + echo ' '; } $esc_number = esc_attr( $args['number'] ); diff --git a/wp-mail.php b/wp-mail.php index 60287a07bc..4a70c7cc23 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -60,6 +60,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); @@ -125,7 +128,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 3d211043eb..8fe5b087be 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. *