[ Index ]

MailPress 7.2

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-admin/includes/settings/general/ -> update.php (source)

   1  <?php // general  => one sanitize here, mostly selects and radio buttons + email is checked with email validator (RFC822,2822,5321,5322,6530,6531,6532) those RFC are not supported by Wp
   2  
   3  $mp_general        = get_option( MailPress::option_name_general );    
   4  
   5  if ( isset( MP_AdminPage::$pst_['general'] ))
   6  {
   7      $mp_general['tab']= 'general';
   8  
   9      $mp_general    = stripslashes_deep( MP_AdminPage::$pst_['general'] );
  10  
  11      $mp_general['fromname'] = $mp_general['fromname'];
  12  
  13      switch ( true )
  14      {
  15          case ( !MailPress::is_email( $mp_general['fromemail'] ) ) :
  16              MP_AdminPage::$err_mess['fromemail'] = __( 'field should be an email', 'MailPress' );
  17          break;
  18          case ( empty( $mp_general['fromname'] ) ) :
  19              MP_AdminPage::$err_mess['fromname'] = __( 'field should be a name', 'MailPress' );
  20          break;
  21          case ( ( 'ajax' != $mp_general['subscription_mngt'] ) && ( !is_numeric( $mp_general['id'] ) ) ) :
  22              MP_AdminPage::$err_mess['subscription_mngt'] = __( 'field should be numeric', 'MailPress' );
  23          break;
  24          default :
  25              $mp_general['gmapkey']     = trim( $mp_general['gmapkey']     );
  26              $mp_general['mapboxtoken'] = trim( $mp_general['mapboxtoken'] );
  27              if ( empty( $mp_general['gmapkey'] ) && empty( $mp_general['mapboxtoken'] ) ) $mp_general['map_provider'] = 'o';
  28  
  29              do_action( 'MailPress_settings_general_update' );
  30  
  31              if ( 'ajax' == $mp_general['subscription_mngt'] ) $mp_general['id'] = '';
  32  
  33              update_option( MailPress::option_name_general, $mp_general );
  34  
  35              $message = __( 'General settings saved', 'MailPress' );
  36          break;
  37      }
  38  }


Generated: Tue May 19 15:55:14 2020 Cross-referenced by PHPXref 0.7.1