Make WordPress Core

Ticket #42461: 42461.diff

File 42461.diff, 5.0 KB (added by welcher, 7 years ago)

Removing unneeded sanitize_text_field calls

  • src/wp-includes/widgets/class-wp-widget-archives.php

    diff --git src/wp-includes/widgets/class-wp-widget-archives.php src/wp-includes/widgets/class-wp-widget-archives.php
    index 56f45654fb..c54b748ea3 100644
    class WP_Widget_Archives extends WP_Widget { 
    173173                                'dropdown' => '',
    174174                        )
    175175                );
    176                 $title    = sanitize_text_field( $instance['title'] );
    177176                ?>
    178                 <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <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( $title ); ?>" /></p>
     177                <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <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( $instance['title'] ); ?>" /></p>
    179178                <p>
    180179                        <input class="checkbox" type="checkbox"<?php checked( $instance['dropdown'] ); ?> id="<?php echo $this->get_field_id( 'dropdown' ); ?>" name="<?php echo $this->get_field_name( 'dropdown' ); ?>" /> <label for="<?php echo $this->get_field_id( 'dropdown' ); ?>"><?php _e( 'Display as dropdown' ); ?></label>
    181180                        <br/>
  • src/wp-includes/widgets/class-wp-widget-calendar.php

    diff --git src/wp-includes/widgets/class-wp-widget-calendar.php src/wp-includes/widgets/class-wp-widget-calendar.php
    index c19a3a29a3..de32ac2ce1 100644
    class WP_Widget_Calendar extends WP_Widget { 
    9696         */
    9797        public function form( $instance ) {
    9898                $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
    99                 $title    = sanitize_text_field( $instance['title'] );
    10099                ?>
    101100                <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    102                 <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( $title ); ?>" /></p>
     101                <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( $instance['title'] ); ?>" /></p>
    103102                <?php
    104103        }
    105104}
  • src/wp-includes/widgets/class-wp-widget-categories.php

    diff --git src/wp-includes/widgets/class-wp-widget-categories.php src/wp-includes/widgets/class-wp-widget-categories.php
    index 13be3425e1..f8a9dd60b9 100644
    class WP_Widget_Categories extends WP_Widget { 
    160160        public function form( $instance ) {
    161161                //Defaults
    162162                $instance     = wp_parse_args( (array) $instance, array( 'title' => '' ) );
    163                 $title        = sanitize_text_field( $instance['title'] );
    164163                $count        = isset( $instance['count'] ) ? (bool) $instance['count'] : false;
    165164                $hierarchical = isset( $instance['hierarchical'] ) ? (bool) $instance['hierarchical'] : false;
    166165                $dropdown     = isset( $instance['dropdown'] ) ? (bool) $instance['dropdown'] : false;
    167166                ?>
    168167                <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    169                 <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( $title ); ?>" /></p>
     168                <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( $instance['title'] ); ?>" /></p>
    170169
    171170                <p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id( 'dropdown' ); ?>" name="<?php echo $this->get_field_name( 'dropdown' ); ?>"<?php checked( $dropdown ); ?> />
    172171                <label for="<?php echo $this->get_field_id( 'dropdown' ); ?>"><?php _e( 'Display as dropdown' ); ?></label><br />
  • src/wp-includes/widgets/class-wp-widget-meta.php

    diff --git src/wp-includes/widgets/class-wp-widget-meta.php src/wp-includes/widgets/class-wp-widget-meta.php
    index 2df1f7030d..6f2713909b 100644
    class WP_Widget_Meta extends WP_Widget { 
    111111         */
    112112        public function form( $instance ) {
    113113                $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );
    114                 $title    = sanitize_text_field( $instance['title'] );
    115114?>
    116                         <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <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( $title ); ?>" /></p>
     115                        <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <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( $instance['title'] ); ?>" /></p>
    117116<?php
    118117        }
    119118}