Avoid PHP notices when configuring the Incoming Links dashboard widget. fixes #25250.
git-svn-id: https://develop.svn.wordpress.org/trunk@25298 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ed6316d44b
commit
8e4a6b31cd
@ -1095,6 +1095,7 @@ function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) {
|
||||
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-rss'][$number]) ) {
|
||||
$_POST['widget-rss'][$number] = wp_unslash( $_POST['widget-rss'][$number] );
|
||||
$widget_options[$widget_id] = wp_widget_rss_process( $_POST['widget-rss'][$number] );
|
||||
$widget_options[$widget_id]['number'] = $number;
|
||||
// title is optional. If black, fill it if possible
|
||||
if ( !$widget_options[$widget_id]['title'] && isset($_POST['widget-rss'][$number]['title']) ) {
|
||||
$rss = fetch_feed($widget_options[$widget_id]['url']);
|
||||
|
@ -929,7 +929,7 @@ 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 );
|
||||
extract( $args );
|
||||
extract( $inputs, EXTR_SKIP);
|
||||
extract( $inputs, EXTR_SKIP );
|
||||
|
||||
$number = esc_attr( $number );
|
||||
$title = esc_attr( $title );
|
||||
@ -1000,11 +1000,11 @@ function wp_widget_rss_process( $widget_rss, $check_feed = true ) {
|
||||
$items = (int) $widget_rss['items'];
|
||||
if ( $items < 1 || 20 < $items )
|
||||
$items = 10;
|
||||
$url = esc_url_raw(strip_tags( $widget_rss['url'] ));
|
||||
$title = trim(strip_tags( $widget_rss['title'] ));
|
||||
$show_summary = isset($widget_rss['show_summary']) ? (int) $widget_rss['show_summary'] : 0;
|
||||
$show_author = isset($widget_rss['show_author']) ? (int) $widget_rss['show_author'] :0;
|
||||
$show_date = isset($widget_rss['show_date']) ? (int) $widget_rss['show_date'] : 0;
|
||||
$url = esc_url_raw( strip_tags( $widget_rss['url'] ) );
|
||||
$title = isset( $widget_rss['title'] ) ? trim( strip_tags( $widget_rss['title'] ) ) : '';
|
||||
$show_summary = isset( $widget_rss['show_summary'] ) ? (int) $widget_rss['show_summary'] : 0;
|
||||
$show_author = isset( $widget_rss['show_author'] ) ? (int) $widget_rss['show_author'] :0;
|
||||
$show_date = isset( $widget_rss['show_date'] ) ? (int) $widget_rss['show_date'] : 0;
|
||||
|
||||
if ( $check_feed ) {
|
||||
$rss = fetch_feed($url);
|
||||
|
Loading…
Reference in New Issue
Block a user