Plugin Directory

Changeset 476945


Ignore:
Timestamp:
12/17/2011 09:17:15 PM (14 years ago)
Author:
manfer
Message:

Fixed validation code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contact-form-7-bwp-recaptcha-extension/trunk/includes/CF7bwpCAPT.class.php

    r476944 r476945  
    276276        function validate_options( $input ) {
    277277           
    278             print_r($input);
    279 
    280278            // Allowed values
    281279            $theme_selections = array(
     
    290288            );
    291289
    292             if ( $validated[ 'select_theme' ] === 'cf7' ) {
    293        
    294                 // Allowed values
    295                 $themes = array(
    296                     'red',
    297                     'white',
    298                     'blackglass',
    299                     'clean'
    300                 );
    301 
    302                 $validated[ 'cf7_theme' ] = $this->validate_option(
    303                     $themes,
    304                     'cf7_theme',
    305                     $input[ 'cf7_theme' ]
    306                 );
    307             } else {
    308                 $validated[ 'cf7_theme' ] = $this->options[ 'cf7_theme' ];
    309             }       
     290            // Allowed values
     291            $themes = array(
     292                'red',
     293                'white',
     294                'blackglass',
     295                'clean'
     296            );
     297
     298            $validated[ 'cf7_theme' ] = $this->validate_option(
     299                $themes,
     300                'cf7_theme',
     301                $input[ 'cf7_theme' ]
     302            );
    310303
    311304            // Allowed values
     
    321314            );
    322315
    323             if ( $validated[ 'select_lang' ] === 'cf7' ) {
    324 
    325                 // Allowed values
    326                 $recaptcha_languages = array(
    327                     'en',
    328                     'nl',
    329                     'fr',
    330                     'de',
    331                     'pt',
    332                     'ru',
    333                     'es',
    334                     'tr'
    335                 );
    336 
    337                 $validated[ 'cf7_lang' ] = $this->validate_option(
    338                     $recaptcha_languages,
    339                     'cf7_lang',
    340                     $input[ 'cf7_lang' ]
    341                 );
    342             } else {
    343                 $validated[ 'cf7_lang' ] = $this->options['cf7_lang'];
    344             }
     316            // Allowed values
     317            $recaptcha_languages = array(
     318                'en',
     319                'nl',
     320                'fr',
     321                'de',
     322                'pt',
     323                'ru',
     324                'es',
     325                'tr'
     326            );
     327
     328            $validated[ 'cf7_lang' ] = $this->validate_option(
     329                $recaptcha_languages,
     330                'cf7_lang',
     331                $input[ 'cf7_lang' ]
     332            );
    345333
    346334            return $validated;
Note: See TracChangeset for help on using the changeset viewer.