Index: trunk/wp-admin/includes/dashboard.php =================================================================== --- trunk/wp-admin/includes/dashboard.php (revision 16900) +++ trunk/wp-admin/includes/dashboard.php (revision 16922) @@ -607,8 +607,6 @@ $widgets = get_option( 'dashboard_widget_options' ); - if ( isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) ) - $total_items = (int) $widgets['dashboard_recent_comments']['items']; - else - $total_items = 5; + $total_items = isset( $widgets['dashboard_recent_comments'] ) && isset( $widgets['dashboard_recent_comments']['items'] ) + ? absint( $widgets['dashboard_recent_comments']['items'] ) : 5; while ( count( $comments ) < 5 && $possible = $wpdb->get_results( "SELECT * FROM $wpdb->comments c LEFT JOIN $wpdb->posts p ON c.comment_post_ID = p.ID WHERE p.post_status != 'trash' ORDER BY c.comment_date_gmt DESC LIMIT $start, 50" ) ) { @@ -758,7 +756,5 @@ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['widget-recent-comments']) ) { - $number = (int) stripslashes($_POST['widget-recent-comments']['items']); - if ( $number < 1 || $number > 30 ) - $number = 5; + $number = absint( stripslashes($_POST['widget-recent-comments']['items']) ); $widget_options['dashboard_recent_comments']['items'] = $number; update_option( 'dashboard_widget_options', $widget_options ); @@ -768,5 +764,5 @@ echo '
'; - echo ' ' . __( '(at most 30)' ) . '
'; + echo ''; }