[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php // list_unsubscribe => no sanitize here, 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  if ( isset( MP_AdminPage::$pst_['list_unsubscribe'] ) ) 
   4  {
   5      $list_unsubscribe    = MP_AdminPage::$pst_['list_unsubscribe'];
   6  
   7      switch ( true )
   8      {
   9          case ( empty( $list_unsubscribe['pop3']['server'] ) ) :
  10              MP_AdminPage::$err_mess['list_unsubscribe_pop3_server'] = __( 'field should not be empty', 'MailPress' );
  11          break;
  12          case ( empty( $list_unsubscribe['pop3']['port'] ) ) :
  13              MP_AdminPage::$err_mess['list_unsubscribe_pop3_port'] = __( 'field should not be empty', 'MailPress' );
  14          break;
  15          case ( !is_numeric( $list_unsubscribe['pop3']['port'] ) ) : 
  16              MP_AdminPage::$err_mess['list_unsubscribe_pop3_port'] = __( 'field should be a number', 'MailPress' );
  17          break;
  18          case ( empty( $list_unsubscribe['pop3']['username'] ) && !empty( $list_unsubscribe['pop3']['password'] ) ) :
  19              MP_AdminPage::$err_mess['list_unsubscribe_pop3_username'] = __( 'field should not be empty', 'MailPress' );
  20          break;
  21          case ( !in_array( $list_unsubscribe['mode'], array( 'a', 'b', 'c', ) ) ) :
  22              MP_AdminPage::$err_mess['list_unsubscribe_mode'] = __( 'field should not be empty', 'MailPress' );
  23          break;
  24  
  25          default :
  26              $old_list_unsubscribe = get_option( MailPress_list_unsubscribe::option_name );
  27  
  28              update_option( MailPress_list_unsubscribe::option_name, $list_unsubscribe );
  29              $message = __( "'List-Unsubscribe' settings saved", 'MailPress' );
  30  
  31              if ( !isset( $old_list_unsubscribe['batch_mode'] ) ) 
  32              {
  33                  $old_list_unsubscribe['batch_mode'] = '';
  34              }
  35  
  36              if ( $old_list_unsubscribe['batch_mode'] != $list_unsubscribe['batch_mode'] )
  37              {
  38                  if ( 'wpcron' != $list_unsubscribe['batch_mode'] )
  39                  {
  40                      wp_clear_scheduled_hook( MailPress_list_unsubscribe::process_name );
  41                  }
  42                  else
  43                  {
  44                      MailPress_list_unsubscribe::schedule();
  45                  }
  46              }
  47          break;
  48      }
  49  }


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