Skip to content

Commit

Permalink
sanitize user input
Browse files Browse the repository at this point in the history
  • Loading branch information
kangabell committed Feb 18, 2015
1 parent 86a96f3 commit 08f3882
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,8 @@ function serena_customize_register( $wp_customize )
'description' => 'Upload a logo to replace the default site name and description in the header',
) );

$wp_customize->add_setting( 'serena_logo' );
$wp_customize->add_setting( 'serena_logo', array(
'sanitize_callback' => 'sanitize_file_name' ));

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'serena_logo', array(
'label' => __( 'Logo', 'serena' ),
Expand All @@ -328,7 +329,11 @@ function serena_customize_register( $wp_customize )

foreach($colors as $color)
{
$wp_customize->add_setting( $color['slug'], array( 'default' => $color['default'], 'type' => 'option', 'capability' => 'edit_theme_options' ));
$wp_customize->add_setting( $color['slug'], array(
'default' => $color['default'],
'type' => 'option',
'capability' => 'edit_theme_options',
'sanitize_callback' => 'sanitize_hex_color' ));

$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, $color['slug'], array(
'label' => $color['label'],
Expand Down

0 comments on commit 08f3882

Please sign in to comment.