Plugin Directory

Changeset 2722284


Ignore:
Timestamp:
05/11/2022 10:08:03 PM (4 years ago)
Author:
Reamaze
Message:

update 1.2.5

Location:
reamaze/tags/1.2.5/includes/admin/settings
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • reamaze/tags/1.2.5/includes/admin/settings/reamaze-settings-page.php

    r2721484 r2722284  
    6969
    7070    foreach ( $options as $value ) {
     71            global $allowedposttags;
    7172      if ( ! isset( $value['id'] ) || ! isset( $value['type'] ) ) {
    7273        continue;
     
    7475
    7576      $option_name = $value['id'];
    76       $option_value = isset( $_POST[ $value['id'] ] ) ? wp_unslash( $_POST[ $value['id'] ] ) : null;
    77 
    78       switch ( sanitize_title( $value['type'] ) ) {
     77            $option_value = '';
     78
     79            switch ( $value['type'] ) {
    7980        case 'checkbox':
    80           $option_value = is_null( $option_value ) ? 'no' : 'yes';
     81          $option_value = is_null( $_POST[ $value['id'] ] ) ? 'no' : 'yes';
    8182          break;
    8283        case 'textarea':
    8384          if ( ! ( isset( $value['raw'] ) && $value['raw'] ) ) {
    84             $option_value = wp_kses_post( trim( $option_value ) );
    85           }
    86           break;
    87         case 'text':
     85            $option_value = sanitize_textarea_field( trim( $_POST[ $value['id'] ] ) );
     86          } else {
     87                        # we need to allow users to insert HTML, script tags, style tags.
     88                        $option_value = trim( wp_unslash( $_POST[ $value['id'] ] ) );
     89          }
     90          break;
    8891        case 'email':
    89         case 'number':
    90         case 'select':
    91         case 'password':
    92         case 'radio':
    93           $option_value = sanitize_text_field( $option_value );
     92          $option_value = sanitize_email( $_POST[ $value['id'] ] );
    9493          break;
    9594        case 'multiselect':
    96           $option_value = array_filter( array_map( 'sanitize_text_field', (array) $option_value ) );
    97           break;
    98         default :
    99                     $option_value = sanitize_text_field( $option_value );
     95          $option_value = array_filter( array_map( 'sanitize_text_field', (array) $_POST[ $value['id'] ] ) );
     96          break;
     97        default:
     98                $option_value = sanitize_text_field( $_POST[ $value['id'] ] );
    10099          break;
    101100      }
  • reamaze/tags/1.2.5/includes/admin/settings/reamaze-settings-personal.php

    r2721484 r2722284  
    5252        'type'     => 'password',
    5353        'default'  => '',
     54                'raw'      => true,
    5455        'user_setting' => true
    5556      ),
Note: See TracChangeset for help on using the changeset viewer.