[ Index ]

MailPress 7.2

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

title

Body

[close]

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

   1  <?php // connection_smtp => no sanitize here : ports are controlled by is_numeric()
   2  
   3  if ( isset( MP_AdminPage::$pst_['connection_smtp'] ) ) 
   4  {
   5      $connection_smtp    = stripslashes_deep( MP_AdminPage::$pst_['connection_smtp'] );
   6  
   7      if ( 'custom' == $connection_smtp['port'] ) $connection_smtp ['port'] = $connection_smtp['customport'];
   8      unset( $connection_smtp['customport'] );
   9  
  10      switch ( true )
  11      {
  12          case ( empty( $connection_smtp['server'] ) ) :
  13              MP_AdminPage::$err_mess['server'] = __( 'field should not be empty', 'MailPress' );
  14          break;
  15          case ( empty( $connection_smtp['username'] ) && !empty( $connection_smtp['password'] ) ) :
  16              MP_AdminPage::$err_mess['username'] = __( 'field should not be empty', 'MailPress' );
  17          break;
  18                  case ( isset( $connection_smtp['customport'] ) && !empty( $connection_smtp['customport'] ) && !is_numeric( $connection_smtp[customport] ) ) : 
  19              MP_AdminPage::$err_mess['customport'] = __( 'field should be a number', 'MailPress' );
  20          break;
  21          case ( ( isset( $connection_smtp['smtp-auth'] ) && ( '@PopB4Smtp' == $connection_smtp['smtp-auth'] ) ) && ( empty( $connection_smtp['pophost'] ) ) ) : 
  22              MP_AdminPage::$err_mess['smtp-auth'] = __( 'field should not be empty', 'MailPress' );
  23          break;
  24          case ( ( isset( $connection_smtp['smtp-auth'] ) && ( '@PopB4Smtp' == $connection_smtp['smtp-auth'] ) ) && ( !is_numeric( $connection_smtp['popport'] ) ) ) : 
  25              MP_AdminPage::$err_mess['smtp-auth'] = __( 'field should be a number', 'MailPress' );
  26          break;
  27          default :
  28              update_option( MailPress::option_name_smtp, $connection_smtp );
  29              $message = __( 'SMTP settings saved, Test it !!', 'MailPress' );
  30          break;
  31      }
  32  }


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