WordPress.org

Plugin Directory

Changeset 586272


Ignore:
Timestamp:
08/16/12 16:14:03 (20 months ago)
Author:
simonwheatley
Message:

Fix warnings for checkbox values if checkbox is unchecked

Location:
twitter-tracker/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • twitter-tracker/trunk/class-TwitterTracker_Profile_Widget.php

    r586271 r586272  
    3939        extract( $instance ); 
    4040 
    41         $class = isset( $class ) ? esc_attr( $class ) : ''; 
     41        $class = isset( $class ) ? $class : ''; 
    4242         
    4343        // Add any additional classes 
     
    6565        $new_instance[ 'mandatory_hash' ] = strip_tags( $new_instance[ 'mandatory_hash' ] ); 
    6666        $new_instance[ 'html_after' ] = wp_kses( $new_instance[ 'html_after' ], $GLOBALS[ 'TwitterTracker' ]->allowed_html( 'html_after' ) ); 
    67         $new_instance[ 'class' ] = esc_attr( $new_instance[ 'class' ] ); 
     67        $new_instance[ 'class' ] = $new_instance[ 'class' ]; // Escaped on output, no sanitisation needed here 
    6868        return $new_instance; 
    6969    } 
     
    9999    protected function add_classes( $before_widget, $class ) 
    100100    { 
    101         $classes = "widget_twitter-profile-tracker " . $class . " "; 
     101        $classes = "widget_twitter-profile-tracker " . esc_attr( $class ) . " "; 
    102102        return str_replace( 'widget_twitter-profile-tracker', $classes, $before_widget ); 
    103103    } 
  • twitter-tracker/trunk/class-TwitterTracker_Widget.php

    r586271 r586272  
    3939        extract( $instance ); 
    4040 
    41         $class = isset( $class ) ? esc_attr( $class ) : ''; 
     41        $class = isset( $class ) ? $class : ''; 
    4242         
    4343        // Add any additional classes 
     
    6363        $new_instance[ 'mandatory_hash' ] = strip_tags( $new_instance[ 'mandatory_hash' ] ); 
    6464        $new_instance[ 'html_after' ] = wp_kses( $new_instance[ 'html_after' ], $GLOBALS[ 'TwitterTracker' ]->allowed_html( 'html_after' ) ); 
    65         $new_instance[ 'class' ] = esc_attr( $new_instance[ 'class' ] ); 
     65        $new_instance[ 'class' ] = $new_instance[ 'class' ]; // Escaped on output, no sanitisation needed here 
    6666        return $new_instance; 
    6767    } 
     
    116116    protected function add_classes( $before_widget, $class ) 
    117117    { 
    118         $classes = "widget_twitter-tracker " . $class . " "; 
     118        $classes = "widget_twitter-tracker " . esc_attr( $class ) . " "; 
    119119        return str_replace( 'widget_twitter-tracker', $classes, $before_widget ); 
    120120    } 
Note: See TracChangeset for help on using the changeset viewer.