From 05abd7e56fcf5455e4863de4edbcf92d2dc04b54 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 20 Jun 2014 17:28:12 +0000 Subject: [PATCH] Cleanup `wp_widget_rss_form()` after [28734]. "$$input used sanitized variables which contained actual values, unlike $inputs[$input] which in that context contains data about which input fields are hidden." Props kovshenin. Fixes #27881. git-svn-id: https://develop.svn.wordpress.org/trunk@28787 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/default-widgets.php | 51 +++++++++++++++-------------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/src/wp-includes/default-widgets.php b/src/wp-includes/default-widgets.php index 124f812356..96fd1bebb3 100644 --- a/src/wp-includes/default-widgets.php +++ b/src/wp-includes/default-widgets.php @@ -1108,16 +1108,18 @@ function wp_widget_rss_form( $args, $inputs = null ) { $default_inputs = array( 'url' => true, 'title' => true, 'items' => true, 'show_summary' => true, 'show_author' => true, 'show_date' => true ); $inputs = wp_parse_args( $inputs, $default_inputs ); - $number = esc_attr( $args['number'] ); - $title = isset( $args['title'] ) ? esc_attr( $args['title'] ) : ''; - $url = isset( $args['url'] ) ? esc_url( $args['url'] ) : ''; - $items = isset( $args['items'] ) ? (int) $args['items'] : 0; - if ( $items < 1 || 20 < $items ) { - $items = 10; + $args['number'] = esc_attr( $args['number'] ); + $args['title'] = isset( $args['title'] ) ? esc_attr( $args['title'] ) : ''; + $args['url'] = isset( $args['url'] ) ? esc_url( $args['url'] ) : ''; + $args['items'] = isset( $args['items'] ) ? (int) $args['items'] : 0; + + if ( $args['items'] < 1 || 20 < $args['items'] ) { + $args['items'] = 10; } - $show_summary = isset( $args['show_summary'] ) ? (int) $args['show_summary'] : (int) $inputs['show_summary']; - $show_author = isset( $args['show_author'] ) ? (int) $args['show_author'] : (int) $inputs['show_author']; - $show_date = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date']; + + $args['show_summary'] = isset( $args['show_summary'] ) ? (int) $args['show_summary'] : (int) $inputs['show_summary']; + $args['show_author'] = isset( $args['show_author'] ) ? (int) $args['show_author'] : (int) $inputs['show_author']; + $args['show_date'] = isset( $args['show_date'] ) ? (int) $args['show_date'] : (int) $inputs['show_date']; if ( ! empty( $args['error'] ) ) { echo '

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

'; @@ -1125,35 +1127,36 @@ function wp_widget_rss_form( $args, $inputs = null ) { if ( $inputs['url'] ) : ?> -

-

+

+

-

-

+

+

-

- $i"; + for ( $i = 1; $i <= 20; ++$i ) { + echo ""; + } ?>

-

/> -

+

/> +

-

/> -

+

/> +

-

/> -

+

/> +

- +