[ Index ]

MailPress 7.2

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

title

Body

[close]

/mp-includes/class/ -> MP_Tracking.class.php (source)

   1  <?php
   2  class MP_Tracking
   3  {
   4  	public static function process()
   5      {
   6          $get_ = filter_input_array( INPUT_GET );
   7  
   8          $meta = MP_Mail_meta::get_by_id( $get_['mm'] );
   9          if ( $meta )
  10          {
  11              do_action( 'mp_tracking_process', $meta ); // will activate if any !
  12              switch ( $get_['tg'] )
  13              {
  14                  case ( 'l' ) :
  15                      switch ( $meta->meta_value )
  16                      {
  17                          case '{{subscribe}}' :
  18                              $url = MP_User::get_subscribe_url( $get_['us'] );
  19                          break;
  20                          case '{{unsubscribe}}' :
  21                              $url = MP_User::get_unsubscribe_url( $get_['us'] );
  22                          break;
  23                          case '{{viewhtml}}' :
  24                              $url = MP_User::get_view_url( $get_['us'], $meta->mp_mail_id );
  25                          break;
  26                          default :
  27                              $pattern = '#^(http|https)://[\w-]+[\w.-]+\.[a-zA-Z]{2,6}#i';
  28                              $url = false;
  29                              foreach( array( $meta->meta_value, 'https://' . $meta->meta_value ) as $u ) if ( preg_match( $pattern, $u ) ) $url = $u;
  30                              if ( !$url ) $url = $meta->meta_value;
  31                          break;
  32                      }
  33                      MP_::mp_redirect( $url );
  34                  break;
  35                  case ( 'o' ) :
  36                      header( 'Content-Type: image/gif' );
  37                      readfile( MP_ABSPATH . 'mp-includes/images/_.gif' );
  38                      die();
  39                  break;
  40              }
  41          }
  42          MP_::mp_redirect( home_url() );
  43      }
  44  }


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