Changeset 4886
- Timestamp:
- 05/06/2013 03:47:42 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/includes/common/widgets.php
r4814 r4886 162 162 $instance = $old_instance; 163 163 $instance['title'] = strip_tags( $new_instance['title'] ); 164 $instance['register'] = esc_url ( $new_instance['register'] );165 $instance['lostpass'] = esc_url ( $new_instance['lostpass'] );164 $instance['register'] = esc_url_raw( $new_instance['register'] ); 165 $instance['lostpass'] = esc_url_raw( $new_instance['lostpass'] ); 166 166 167 167 return $instance; … … 601 601 $instance = $old_instance; 602 602 $instance['title'] = strip_tags( $new_instance['title'] ); 603 $instance['parent_forum'] = $new_instance['parent_forum'];603 $instance['parent_forum'] = sanitize_text_field( $new_instance['parent_forum'] ); 604 604 605 605 // Force to any … … 835 835 */ 836 836 public function update( $new_instance = array(), $old_instance = array() ) { 837 $instance = $old_instance; 838 $instance['title'] = strip_tags( $new_instance['title'] ); 839 $instance['order_by'] = strip_tags( $new_instance['order_by'] ); 840 $instance['show_date'] = (bool) $new_instance['show_date']; 841 $instance['show_user'] = (bool) $new_instance['show_user']; 842 $instance['max_shown'] = (int) $new_instance['max_shown']; 837 $instance = $old_instance; 838 $instance['title'] = strip_tags( $new_instance['title'] ); 839 $instance['order_by'] = strip_tags( $new_instance['order_by'] ); 840 $instance['parent_forum'] = sanitize_text_field( $new_instance['parent_forum'] ); 841 $instance['show_date'] = (bool) $new_instance['show_date']; 842 $instance['show_user'] = (bool) $new_instance['show_user']; 843 $instance['max_shown'] = (int) $new_instance['max_shown']; 843 844 844 845 // Force to any 845 if ( !empty( $instance['parent_forum'] ) ||!is_numeric( $instance['parent_forum'] ) ) {846 if ( !empty( $instance['parent_forum'] ) && !is_numeric( $instance['parent_forum'] ) ) { 846 847 $instance['parent_forum'] = 'any'; 847 } else {848 $instance['parent_forum'] = (int) $new_instance['parent_forum'];849 848 } 850 849 … … 879 878 </p> 880 879 881 <p><label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show post date:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( 'on', $settings['show_date'] ); ?>/></label></p>882 <p><label for="<?php echo $this->get_field_id( 'show_user' ); ?>"><?php _e( 'Show topic author:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_user' ); ?>" name="<?php echo $this->get_field_name( 'show_user' ); ?>" <?php checked( 'on', $settings['show_user'] ); ?>/></label></p>880 <p><label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show post date:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( true, $settings['show_date'] ); ?> value="1" /></label></p> 881 <p><label for="<?php echo $this->get_field_id( 'show_user' ); ?>"><?php _e( 'Show topic author:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_user' ); ?>" name="<?php echo $this->get_field_name( 'show_user' ); ?>" <?php checked( true, $settings['show_user'] ); ?> value="1" /></label></p> 883 882 884 883 <p> … … 1225 1224 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $settings['title'] ); ?>" /></label></p> 1226 1225 <p><label for="<?php echo $this->get_field_id( 'max_shown' ); ?>"><?php _e( 'Maximum replies to show:', 'bbpress' ); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_shown' ); ?>" name="<?php echo $this->get_field_name( 'max_shown' ); ?>" type="text" value="<?php echo esc_attr( $settings['max_shown'] ); ?>" /></label></p> 1227 <p><label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show post date:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( 'on', $settings['show_date'] ); ?>/></label></p>1228 <p><label for="<?php echo $this->get_field_id( 'show_user' ); ?>"><?php _e( 'Show reply author:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_user' ); ?>" name="<?php echo $this->get_field_name( 'show_user' ); ?>" <?php checked( 'on', $settings['show_user'] ); ?>/></label></p>1226 <p><label for="<?php echo $this->get_field_id( 'show_date' ); ?>"><?php _e( 'Show post date:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_date' ); ?>" name="<?php echo $this->get_field_name( 'show_date' ); ?>" <?php checked( true, $settings['show_date'] ); ?> value="1" /></label></p> 1227 <p><label for="<?php echo $this->get_field_id( 'show_user' ); ?>"><?php _e( 'Show reply author:', 'bbpress' ); ?> <input type="checkbox" id="<?php echo $this->get_field_id( 'show_user' ); ?>" name="<?php echo $this->get_field_name( 'show_user' ); ?>" <?php checked( true, $settings['show_user'] ); ?> value="1" /></label></p> 1229 1228 1230 1229 <?php
Note: See TracChangeset
for help on using the changeset viewer.