Widgets: Escape RSS error messages for display.

Props xknown, timothyblynjacobs, matveb, talldanwp.
Merges [54541] to the 6.0 branch.

Built from https://develop.svn.wordpress.org/branches/6.0@54542


git-svn-id: http://core.svn.wordpress.org/branches/6.0@54097 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
audrasjb 2022-10-17 12:43:09 +00:00
parent 2cd7afea5e
commit 2466ee5c06
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.0.3-alpha-54540';
$wp_version = '6.0.3-alpha-54542';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -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 '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . $rss->get_error_message() . '</p>';
echo '<p><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $rss->get_error_message() ) . '</p>';
}
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 '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . $args['error'] . '</p>';
echo '<p class="widget-error"><strong>' . __( 'RSS Error:' ) . '</strong> ' . esc_html( $args['error'] ) . '</p>';
}
$esc_number = esc_attr( $args['number'] );