diff --git a/admin/section/class-convertkit-settings-contactform7.php b/admin/section/class-convertkit-settings-contactform7.php index 4e5917e51..bd0346362 100644 --- a/admin/section/class-convertkit-settings-contactform7.php +++ b/admin/section/class-convertkit-settings-contactform7.php @@ -224,7 +224,7 @@ public function cf7_form_callback( $args ) { $cf7_form_id = $args['cf7_form_id']; $forms = $args['forms']; - $html = sprintf( '', $this->settings_key, $cf7_form_id ); $html .= ''; foreach ( $forms as $form ) { $selected = ''; @@ -271,12 +271,14 @@ public function cf7_name_callback( $args ) { */ public function sanitize_settings( $input ) { // Settings page can be paginated; combine input with existing options. - $output = $this->options; + // If saved options are not an array, start fresh. Fixes rogue saved options + $output = is_array( $this->options ) ? $this->options : array(); foreach ( $input as $key => $value ) { - $output[ $key ] = stripslashes( $input[ $key ] ); + $output[ $key ] = sanitize_text_field( $value ); } $sanitize_hook = 'sanitize' . $this->settings_key; + return apply_filters( $sanitize_hook, $output, $input ); } }