[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php // bounce_handling => 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_['bounce_handling'] ) ) 
   4  {
   5      $bounce_handling = MP_AdminPage::$pst_['bounce_handling'];
   6  
   7      switch ( true )
   8      {
   9          case ( empty( $bounce_handling['pop3']['server'] ) ) :
  10              MP_AdminPage::$err_mess['bounce_handling_pop3_server'] = __( 'field should not be empty', 'MailPress' );
  11          break;
  12          case ( empty( $bounce_handling['pop3']['port'] ) ) :
  13              MP_AdminPage::$err_mess['bounce_handling_pop3_port'] = __( 'field should not be empty', 'MailPress' );
  14          break;
  15          case ( !is_numeric( $bounce_handling['pop3']['port'] ) ) : 
  16              MP_AdminPage::$err_mess['bounce_handling_pop3_port'] = __( 'field should be a number', 'MailPress' );
  17          break;
  18          case ( empty( $bounce_handling['pop3']['username'] ) && !empty( $bounce_handling['pop3']['password'] ) ) :
  19              MP_AdminPage::$err_mess['bounce_handling_pop3_username'] = __( 'field should not be empty', 'MailPress' );
  20          break;
  21          case ( !MailPress::is_email( $bounce_handling['Return-Path'] ) ) :
  22              MP_AdminPage::$err_mess['Return-Path'] = __( 'field should be an email', 'MailPress' );
  23          break;
  24          default :
  25              $old_bounce_handling = get_option( MailPress_bounce_handling::option_name );
  26  
  27              update_option( MailPress_bounce_handling::option_name, $bounce_handling );
  28              $message = __( "'Bounce' settings saved", 'MailPress' );
  29  
  30              if ( !isset( $old_bounce_handling['batch_mode'] ) )
  31              {
  32                  $old_bounce_handling['batch_mode'] = '';
  33              }
  34  
  35              if ( $old_bounce_handling['batch_mode'] != $bounce_handling['batch_mode'] )
  36              {
  37                  if ( 'wpcron' != $bounce_handling['batch_mode'] )
  38                  {
  39                      wp_clear_scheduled_hook( MailPress_bounce_handling::process_name );
  40                  }
  41                  else
  42                  {
  43                      MailPress_bounce_handling::schedule();
  44                  }
  45              }
  46          break;
  47      }
  48  }


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