From 929cf3cb9580636f1ae3fe944b8faf8cca420492 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Mon, 17 Oct 2022 12:39:40 +0000 Subject: [PATCH] Widgets: Escape RSS error messages for display. Props xknown, timothyblynjacobs, matveb, talldanwp. git-svn-id: https://develop.svn.wordpress.org/trunk@54541 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/widgets.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/widgets.php b/src/wp-includes/widgets.php index 639c59afa1..015cb3c48a 100644 --- a/src/wp-includes/widgets.php +++ b/src/wp-includes/widgets.php @@ -1578,7 +1578,7 @@ function wp_widget_rss_output( $rss, $args = array() ) { if ( is_wp_error( $rss ) ) { if ( is_admin() || current_user_can( 'manage_options' ) ) { - echo '

' . __( 'RSS Error:' ) . ' ' . $rss->get_error_message() . '

'; + echo '

' . __( 'RSS Error:' ) . ' ' . esc_html( $rss->get_error_message() ) . '

'; } return; } @@ -1701,7 +1701,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 '

' . __( 'RSS Error:' ) . ' ' . $args['error'] . '

'; + echo '

' . __( 'RSS Error:' ) . ' ' . esc_html( $args['error'] ) . '

'; } $esc_number = esc_attr( $args['number'] );