Ticket #14543: 14543.3.patch
File 14543.3.patch, 1.6 KB (added by , 14 years ago) |
---|
-
wp-includes/default-widgets.php
537 537 $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts') : $instance['title'], $instance, $this->id_base); 538 538 if ( !$number = (int) $instance['number'] ) 539 539 $number = 10; 540 else if ( $number < 1 )541 $number = 1;542 else if ( $number > 15 )543 $number = 15;544 540 545 541 $r = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => true)); 546 542 if ($r->have_posts()) : … … 567 563 $instance = $old_instance; 568 564 $instance['title'] = strip_tags($new_instance['title']); 569 565 $instance['number'] = (int) $new_instance['number']; 566 if( $instance['number'] < 1 || $instance['number'] > 15 ) 567 $instance['number'] = 5; 570 568 $this->flush_widget_cache(); 571 569 572 570 $alloptions = wp_cache_get( 'alloptions', 'options' ); … … 641 639 642 640 if ( ! $number = (int) $instance['number'] ) 643 641 $number = 5; 644 else if ( $number < 1 )645 $number = 1;646 642 647 643 $comments = get_comments( array( 'number' => $number, 'status' => 'approve' ) ); 648 644 $output .= $before_widget; … … 667 663 $instance = $old_instance; 668 664 $instance['title'] = strip_tags($new_instance['title']); 669 665 $instance['number'] = (int) $new_instance['number']; 666 if( $instance['number'] < 1 || $instance['number'] > apply_filters( 'wp_recent_comments_limit', 20 ) ) 667 $instance['number'] = 20; 670 668 $this->flush_widget_cache(); 671 669 672 670 $alloptions = wp_cache_get( 'alloptions', 'options' );