MailPoet Newsletters (Previous) - Version 2.7.6

Version Description

  • 2017-01-18 =
  • Fixed post categories not being displayed in sent newsletters
  • Fixed PHPMailer vulnerability
  • Fixed PEAR POP3's usage of static methods
  • Fixed direct manipulation of the $wp_filter global
  • Fixed BBPress unsubscribe compatibility
  • Added ElasticEmail unsubscribe tag
Download this release

Release Info

Developer wysija
Plugin Icon 128x128 MailPoet Newsletters (Previous)
Version 2.7.6
Comparing to
See all releases

Code changes from version 2.7.5 to 2.7.6

controllers/back/campaigns.php CHANGED
@@ -126,7 +126,7 @@ class WYSIJA_control_back_campaigns extends WYSIJA_control_back {
126
  '<li>'.__('What we’re working on',WYSIJA).'</li>' .
127
  '<li>'.__('News from us, the team',WYSIJA).'</li>' .
128
  '</ul>
129
- <p>View an <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=1181&wysijap=subscriptions-3">an example blog post email</a> and <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=64&wysijap=subscriptions-2">an example newsletter</a>.</p>
130
  </div>' .
131
  '<div class="mpoet-update-subscribe-right">' .
132
 
126
  '<li>'.__('What we’re working on',WYSIJA).'</li>' .
127
  '<li>'.__('News from us, the team',WYSIJA).'</li>' .
128
  '</ul>
129
+ <p>View <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=1181&wysijap=subscriptions-3">an example blog post email</a> and <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=64&wysijap=subscriptions-2">an example newsletter</a>.</p>
130
  </div>' .
131
  '<div class="mpoet-update-subscribe-right">' .
132
 
controllers/front/confirm.php CHANGED
@@ -49,6 +49,7 @@ class WYSIJA_control_front_confirm extends WYSIJA_control_front{
49
  }
50
 
51
  function unsubscribe(){
 
52
  $model_config=WYSIJA::get('config','model');
53
 
54
  // we need to call the translation otherwise it will not be loaded and translated
49
  }
50
 
51
  function unsubscribe(){
52
+ remove_action( 'bp_get_request_unsubscribe', 'bp_email_unsubscribe_handler' );
53
  $model_config=WYSIJA::get('config','model');
54
 
55
  // we need to call the translation otherwise it will not be loaded and translated
core/base.php CHANGED
@@ -19,7 +19,7 @@ class WYSIJA_object{
19
  * Static variable holding core MailPoet's version
20
  * @var array
21
  */
22
- static $version = '2.7.5';
23
 
24
  function __construct(){}
25
 
19
  * Static variable holding core MailPoet's version
20
  * @var array
21
  */
22
+ static $version = '2.7.6';
23
 
24
  function __construct(){}
25
 
helpers/back.php CHANGED
@@ -354,7 +354,7 @@ class WYSIJA_help_back extends WYSIJA_help{
354
  $msg=$config->getValue('ignore_msgs');
355
  if(!isset($msg['queuesendsslow'])){
356
  $this->notice(
357
- __('Tired of waiting more than 48h to send your emails?',WYSIJA).' '. str_replace(array('[link]','[/link]'), array('<a href="http://support.mailpoet.com/knowledgebase/how-fast-can-i-send-emails-optimal-sending-configurations-explained/?utm_source=wpadmin&utm_campaign=slowqueue" target="_blank">','</a>'), __('[link]Find out[/link] how you can improve this.',WYSIJA)).
358
  ' <a class="linkignore queuesendsslow" href="javascript:;">'.__('Hide!',WYSIJA).'</a>');
359
  }
360
  }
354
  $msg=$config->getValue('ignore_msgs');
355
  if(!isset($msg['queuesendsslow'])){
356
  $this->notice(
357
+ __('Tired of waiting more than 48h to send your emails?',WYSIJA).' '. str_replace(array('[link]','[/link]'), array('<a href="http://docs.mailpoet.com/article/48-wp-cron-batch-emails-sending-frequency" target="_blank">','</a>'), __('[link]Find out[/link] how you can improve this.',WYSIJA)).
358
  ' <a class="linkignore queuesendsslow" href="javascript:;">'.__('Hide!',WYSIJA).'</a>');
359
  }
360
  }
helpers/conflicts.php CHANGED
@@ -68,21 +68,22 @@ class WYSIJA_help_conflicts extends WYSIJA_object{
68
  $this->remove_actions('admin_enqueue_scripts');
69
  }
70
 
 
 
71
  function remove_actions($actionsToClear){
72
- //Carefull WordPress global
73
  global $wp_filter;
74
 
75
- foreach($wp_filter[$actionsToClear] as $priority => $callbacks) {
76
 
 
77
  if(!isset($this->cleanHooks[$actionsToClear][$priority])) continue;
78
 
79
  foreach($callbacks as $identifier => $arrayInfo){
80
-
81
  if(is_array($arrayInfo['function'])){
82
  foreach($arrayInfo['function'] as $id => $myobject){
83
  foreach($this->cleanHooks[$actionsToClear][$priority] as $infoClear) {
84
  if(isset($infoClear['objects']) && is_object($myobject) && in_array(get_class($myobject),$infoClear['objects'])){
85
- unset($wp_filter[$actionsToClear][$priority][$identifier]);
86
  }
87
  }
88
  }
@@ -90,15 +91,17 @@ class WYSIJA_help_conflicts extends WYSIJA_object{
90
  foreach($this->cleanHooks[$actionsToClear][$priority] as $infoClear){
91
  // if there is more than one function specified (key: functions, type: array)
92
  if(isset($infoClear["functions"]) && function_exists($arrayInfo['function']) && in_array($arrayInfo['function'],$infoClear["functions"])){
93
- unset($wp_filter[$actionsToClear][$priority][$identifier]);
 
 
94
  // if there is only one function to remove (key: function, type: string)
95
  } else if(array_key_exists('function', $infoClear) && $infoClear['function'] === $arrayInfo['function']) {
96
- unset($wp_filter[$actionsToClear][$priority][$identifier]);
97
  }
98
  }
99
 
100
  }
101
  }
102
  }
103
- }
104
  }
68
  $this->remove_actions('admin_enqueue_scripts');
69
  }
70
 
71
+
72
+
73
  function remove_actions($actionsToClear){
 
74
  global $wp_filter;
75
 
76
+ if (!isset($wp_filter[$actionsToClear])) return;
77
 
78
+ foreach($wp_filter[$actionsToClear] as $priority => $callbacks) {
79
  if(!isset($this->cleanHooks[$actionsToClear][$priority])) continue;
80
 
81
  foreach($callbacks as $identifier => $arrayInfo){
 
82
  if(is_array($arrayInfo['function'])){
83
  foreach($arrayInfo['function'] as $id => $myobject){
84
  foreach($this->cleanHooks[$actionsToClear][$priority] as $infoClear) {
85
  if(isset($infoClear['objects']) && is_object($myobject) && in_array(get_class($myobject),$infoClear['objects'])){
86
+ remove_action( $actionsToClear, $infoClear['function'], $priority, $arrayInfo['accepted_args'] );
87
  }
88
  }
89
  }
91
  foreach($this->cleanHooks[$actionsToClear][$priority] as $infoClear){
92
  // if there is more than one function specified (key: functions, type: array)
93
  if(isset($infoClear["functions"]) && function_exists($arrayInfo['function']) && in_array($arrayInfo['function'],$infoClear["functions"])){
94
+ foreach($infoClear['functions'] as $function) {
95
+ remove_action( $actionsToClear, $function, $priority, $arrayInfo['accepted_args'] );
96
+ }
97
  // if there is only one function to remove (key: function, type: string)
98
  } else if(array_key_exists('function', $infoClear) && $infoClear['function'] === $arrayInfo['function']) {
99
+ remove_action( $actionsToClear, $infoClear['function'], $priority, $arrayInfo['accepted_args'] );
100
  }
101
  }
102
 
103
  }
104
  }
105
  }
106
+ }
107
  }
helpers/mailer.php CHANGED
@@ -1015,7 +1015,14 @@ class WYSIJA_help_mailer extends acymailingPHPMailer {
1015
  }
1016
 
1017
  $mytracker=WYSIJA::get_permalink($modelConf->getValue($page_id),$args);
1018
- $urls[$results[0][$i]] = str_replace($url,$mytracker,$results[0][$i]);
 
 
 
 
 
 
 
1019
  }
1020
  $email->body = str_replace(array_keys($urls),$urls,$email->body);
1021
 
1015
  }
1016
 
1017
  $mytracker=WYSIJA::get_permalink($modelConf->getValue($page_id),$args);
1018
+
1019
+ // overwrite unsubscribe link when sending with Elastic Email
1020
+ if(strpos($email_url, '[unsubscribe_link]')!==false){
1021
+ $mailer_host = $modelConf->getValue('smtp_host');
1022
+ $mytracker = (preg_match('/elastic/i', $mailer_host)) ? "{unsubscribe:{$mytracker}}" : $mytracker;
1023
+ }
1024
+
1025
+ $urls[$results[0][$i]] = str_replace($url,$mytracker,$results[0][$i]);
1026
  }
1027
  $email->body = str_replace(array_keys($urls),$urls,$email->body);
1028
 
helpers/wp_tools.php CHANGED
@@ -313,15 +313,13 @@ class WYSIJA_help_wp_tools extends WYSIJA_object{
313
  if ( ! is_object( $post ) || ! is_a( $post, 'WP_Post' ) ) {
314
  return array();
315
  }
316
-
317
- return wp_get_post_terms( $post->ID, get_object_taxonomies( $post->post_type ), array( 'fields' => 'ids' ) );
318
  }
319
 
320
  function get_post_categories( $post = null ) {
321
- if ( ! is_array( $post ) ) {
322
  return array();
323
  }
324
-
325
- return wp_get_post_terms( $post['ID'], get_object_taxonomies( $post['post_type'] ), array( 'fields' => 'names' ) );
326
  }
327
  }
313
  if ( ! is_object( $post ) || ! is_a( $post, 'WP_Post' ) ) {
314
  return array();
315
  }
316
+ return array_map(function($category) { return $category->cat_ID; }, get_the_category($post->ID));
 
317
  }
318
 
319
  function get_post_categories( $post = null ) {
320
+ if ( ! is_array( $post ) || empty($post['ID'] )) {
321
  return array();
322
  }
323
+ return array_map(function($category) { return $category->name; }, get_the_category($post['ID']));
 
324
  }
325
  }
inc/pear/pop3.php CHANGED
@@ -167,9 +167,7 @@ class Net_POP3 {
167
  }
168
  unset($this->supportedAuthMethods[$pos]);
169
  }
170
-
171
-
172
-
173
  }
174
 
175
 
@@ -188,7 +186,7 @@ class Net_POP3 {
188
 
189
  function _raiseError($msg, $code =-1)
190
  {
191
- return PEAR::raiseError($msg, $code);
192
  }
193
 
194
 
@@ -254,10 +252,10 @@ class Net_POP3 {
254
  {
255
  if ($this->_state == NET_POP3_STATE_AUTHORISATION) {
256
 
257
- if(PEAR::isError($ret= $this->_cmdAuthenticate($user , $pass , $apop ) ) ){
258
  return $ret;
259
  }
260
- if( ! PEAR::isError($ret)){
261
  $this->_state = NET_POP3_STATE_TRANSACTION;
262
  return true;
263
  }
@@ -393,7 +391,7 @@ class Net_POP3 {
393
  {
394
 
395
 
396
- if ( PEAR::isError( $method = $this->_getBestAuthMethod($userMethod) ) ) {
397
  return $method;
398
  }
399
 
@@ -413,7 +411,7 @@ class Net_POP3 {
413
  case 'APOP':
414
  $result = $this->_cmdApop( $uid , $pwd );
415
  // if APOP fails fallback to USER auth
416
- if( PEAR::isError( $result ) ){
417
  //echo "APOP FAILED!!!\n";
418
  $result=$this->_authUSER( $uid , $pwd );
419
  }
@@ -445,10 +443,10 @@ class Net_POP3 {
445
  */
446
  function _authUSER($user, $pass )
447
  {
448
- if ( PEAR::isError($ret=$this->_cmdUser($user) ) ){
449
  return $ret;
450
  }
451
- if ( PEAR::isError($ret=$this->_cmdPass($pass) ) ){
452
  return $ret;
453
  }
454
  return true;
@@ -475,13 +473,13 @@ class Net_POP3 {
475
  {
476
  $cmd=sprintf('AUTH PLAIN %s', base64_encode( chr(0) . $user . chr(0) . $pass ) );
477
 
478
- if ( PEAR::isError( $ret = $this->_send($cmd) ) ) {
479
  return $ret;
480
  }
481
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ){
482
  return $challenge;
483
  }
484
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
485
  return $ret;
486
  }
487
 
@@ -504,30 +502,30 @@ class Net_POP3 {
504
  {
505
  $this->_send('AUTH LOGIN');
506
 
507
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
508
  return $challenge;
509
  }
510
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
511
  return $ret;
512
  }
513
 
514
 
515
- if ( PEAR::isError( $ret = $this->_send(sprintf('%s', base64_encode($user))) ) ) {
516
  return $ret;
517
  }
518
 
519
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
520
  return $challenge;
521
  }
522
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
523
  return $ret;
524
  }
525
 
526
- if ( PEAR::isError( $ret = $this->_send(sprintf('%s', base64_encode($pass))) ) ) {
527
  return $ret;
528
  }
529
 
530
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
531
  return $challenge;
532
  }
533
  return $this->_checkResponse($challenge);
@@ -549,14 +547,14 @@ class Net_POP3 {
549
  */
550
  function _authCRAM_MD5($uid, $pwd )
551
  {
552
- if ( PEAR::isError( $ret = $this->_send( 'AUTH CRAM-MD5' ) ) ) {
553
  return $ret;
554
  }
555
 
556
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
557
  return $challenge;
558
  }
559
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
560
  return $ret;
561
  }
562
 
@@ -570,10 +568,10 @@ class Net_POP3 {
570
  $auth_str = base64_encode( $cram->getResponse( $uid , $pwd , $challenge ) );
571
 
572
 
573
- if ( PEAR::isError($error = $this->_send( $auth_str ) ) ) {
574
  return $error;
575
  }
576
- if ( PEAR::isError( $ret = $this->_recvLn() ) ) {
577
  return $ret;
578
  }
579
  //echo "RET:$ret\n";
@@ -595,14 +593,14 @@ class Net_POP3 {
595
  */
596
  function _authDigest_MD5($uid, $pwd)
597
  {
598
- if ( PEAR::isError( $ret = $this->_send( 'AUTH DIGEST-MD5' ) ) ) {
599
  return $ret;
600
  }
601
 
602
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
603
  return $challenge;
604
  }
605
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
606
  return $ret;
607
  }
608
 
@@ -613,14 +611,14 @@ class Net_POP3 {
613
  $digest = &Auth_SASL::factory('digestmd5');
614
  $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, "localhost", "pop3" ));
615
 
616
- if ( PEAR::isError($error = $this->_send( $auth_str ) ) ) {
617
  return $error;
618
  }
619
 
620
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
621
  return $challenge;
622
  }
623
- if( PEAR::isError($ret=$this->_checkResponse($challenge) )){
624
  return $ret;
625
  }
626
  /*
@@ -628,11 +626,11 @@ class Net_POP3 {
628
  * subsequent authentication, so we just silently ignore it.
629
  */
630
 
631
- if ( PEAR::isError( $challenge = $this->_send("\r\n") ) ) {
632
  return $challenge ;
633
  }
634
 
635
- if ( PEAR::isError( $challenge = $this->_recvLn() ) ) {
636
  return $challenge;
637
  }
638
 
@@ -662,7 +660,7 @@ class Net_POP3 {
662
  if ($this->_state == NET_POP3_STATE_AUTHORISATION) {
663
 
664
  if (!empty($this->_timestamp)) {
665
- if(PEAR::isError($data = $this->_sendCmd('APOP ' . $user . ' ' . md5($this->_timestamp . $pass)) ) ){
666
  return $data;
667
  }
668
  $this->_state = NET_POP3_STATE_TRANSACTION;
@@ -895,7 +893,7 @@ class Net_POP3 {
895
  function _cmdStat()
896
  {
897
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
898
- if(!PEAR::isError($data = $this->_sendCmd('STAT'))){
899
  sscanf($data, '+OK %d %d', $msg_num, $size);
900
  $this->_maildrop['num_msg'] = $msg_num;
901
  $this->_maildrop['size'] = $size;
@@ -919,7 +917,7 @@ class Net_POP3 {
919
  $return=array();
920
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
921
  if (!isset($msg_id)) {
922
- if(!PEAR::isError($data = $this->_sendCmd('LIST') )){
923
  $data = $this->_getMultiline();
924
  $data = explode("\r\n", $data);
925
  foreach ($data as $line) {
@@ -931,7 +929,7 @@ class Net_POP3 {
931
  return $return;
932
  }
933
  } else {
934
- if(!PEAR::isError($data = $this->_sendCmd('LIST ' . $msg_id))){
935
  if($data!=''){
936
  sscanf($data, '+OK %d %d', $msg_id, $size);
937
  return array('msg_id' => $msg_id, 'size' => $size);
@@ -955,7 +953,7 @@ class Net_POP3 {
955
  function _cmdRetr($msg_id)
956
  {
957
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
958
- if(!PEAR::isError($data = $this->_sendCmd('RETR ' . $msg_id) )){
959
  $data = $this->_getMultiline();
960
  return $data;
961
  }
@@ -989,7 +987,7 @@ class Net_POP3 {
989
  function _cmdNoop()
990
  {
991
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
992
- if(!PEAR::isError($data = $this->_sendCmd('NOOP'))){
993
  return true;
994
  }
995
  }
@@ -1005,7 +1003,7 @@ class Net_POP3 {
1005
  function _cmdRset()
1006
  {
1007
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1008
- if(!PEAR::isError($data = $this->_sendCmd('RSET'))){
1009
  return true;
1010
  }
1011
  }
@@ -1039,7 +1037,7 @@ class Net_POP3 {
1039
  {
1040
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1041
 
1042
- if(!PEAR::isError($data = $this->_sendCmd('TOP ' . $msg_id . ' ' . $num_lines))){
1043
  return $this->_getMultiline();
1044
  }
1045
  }
@@ -1058,7 +1056,7 @@ class Net_POP3 {
1058
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1059
 
1060
  if (!isset($msg_id)) {
1061
- if(!PEAR::isError($data = $this->_sendCmd('UIDL') )){
1062
  $data = $this->_getMultiline();
1063
  $data = explode("\r\n", $data);
1064
  foreach ($data as $line) {
@@ -1097,11 +1095,11 @@ class Net_POP3 {
1097
  */
1098
  function _sendCmd($cmd)
1099
  {
1100
- if (PEAR::isError($result = $this->_send($cmd) )){
1101
  return $result ;
1102
  }
1103
 
1104
- if (PEAR::isError($data = $this->_recvLn() )){
1105
  return $data;
1106
  }
1107
 
@@ -1127,7 +1125,7 @@ class Net_POP3 {
1127
  function _getMultiline()
1128
  {
1129
  $data = '';
1130
- while(!PEAR::isError($tmp = $this->_recvLn() ) ) {
1131
  if($tmp == '.'){
1132
  return substr($data, 0, -2);
1133
  }
@@ -1172,7 +1170,7 @@ class Net_POP3 {
1172
  echo "C: $data\n";
1173
  }
1174
 
1175
- if (PEAR::isError($error = $this->_socket->writeLine($data))) {
1176
  return $this->_raiseError('Failed to write to socket: ' . $error->getMessage());
1177
  }
1178
  return true;
@@ -1190,7 +1188,7 @@ class Net_POP3 {
1190
  */
1191
  function _recvLn()
1192
  {
1193
- if (PEAR::isError( $lastline = $this->_socket->readLine( 8192 ) ) ) {
1194
  return $this->_raiseError('Failed to write to socket: ' . $this->lastline->getMessage() );
1195
  }
1196
  if($this->_debug){
167
  }
168
  unset($this->supportedAuthMethods[$pos]);
169
  }
170
+ $this->PEAR = new PEAR();
 
 
171
  }
172
 
173
 
186
 
187
  function _raiseError($msg, $code =-1)
188
  {
189
+ return $this->PEAR->raiseError($msg, $code);
190
  }
191
 
192
 
252
  {
253
  if ($this->_state == NET_POP3_STATE_AUTHORISATION) {
254
 
255
+ if($this->PEAR->isError($ret= $this->_cmdAuthenticate($user , $pass , $apop ) ) ){
256
  return $ret;
257
  }
258
+ if( ! $this->PEAR->isError($ret)){
259
  $this->_state = NET_POP3_STATE_TRANSACTION;
260
  return true;
261
  }
391
  {
392
 
393
 
394
+ if ( $this->PEAR->isError( $method = $this->_getBestAuthMethod($userMethod) ) ) {
395
  return $method;
396
  }
397
 
411
  case 'APOP':
412
  $result = $this->_cmdApop( $uid , $pwd );
413
  // if APOP fails fallback to USER auth
414
+ if( $this->PEAR->isError( $result ) ){
415
  //echo "APOP FAILED!!!\n";
416
  $result=$this->_authUSER( $uid , $pwd );
417
  }
443
  */
444
  function _authUSER($user, $pass )
445
  {
446
+ if ( $this->PEAR->isError($ret=$this->_cmdUser($user) ) ){
447
  return $ret;
448
  }
449
+ if ( $this->PEAR->isError($ret=$this->_cmdPass($pass) ) ){
450
  return $ret;
451
  }
452
  return true;
473
  {
474
  $cmd=sprintf('AUTH PLAIN %s', base64_encode( chr(0) . $user . chr(0) . $pass ) );
475
 
476
+ if ( $this->PEAR->isError( $ret = $this->_send($cmd) ) ) {
477
  return $ret;
478
  }
479
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ){
480
  return $challenge;
481
  }
482
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
483
  return $ret;
484
  }
485
 
502
  {
503
  $this->_send('AUTH LOGIN');
504
 
505
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
506
  return $challenge;
507
  }
508
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
509
  return $ret;
510
  }
511
 
512
 
513
+ if ( $this->PEAR->isError( $ret = $this->_send(sprintf('%s', base64_encode($user))) ) ) {
514
  return $ret;
515
  }
516
 
517
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
518
  return $challenge;
519
  }
520
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
521
  return $ret;
522
  }
523
 
524
+ if ( $this->PEAR->isError( $ret = $this->_send(sprintf('%s', base64_encode($pass))) ) ) {
525
  return $ret;
526
  }
527
 
528
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
529
  return $challenge;
530
  }
531
  return $this->_checkResponse($challenge);
547
  */
548
  function _authCRAM_MD5($uid, $pwd )
549
  {
550
+ if ( $this->PEAR->isError( $ret = $this->_send( 'AUTH CRAM-MD5' ) ) ) {
551
  return $ret;
552
  }
553
 
554
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
555
  return $challenge;
556
  }
557
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
558
  return $ret;
559
  }
560
 
568
  $auth_str = base64_encode( $cram->getResponse( $uid , $pwd , $challenge ) );
569
 
570
 
571
+ if ( $this->PEAR->isError($error = $this->_send( $auth_str ) ) ) {
572
  return $error;
573
  }
574
+ if ( $this->PEAR->isError( $ret = $this->_recvLn() ) ) {
575
  return $ret;
576
  }
577
  //echo "RET:$ret\n";
593
  */
594
  function _authDigest_MD5($uid, $pwd)
595
  {
596
+ if ( $this->PEAR->isError( $ret = $this->_send( 'AUTH DIGEST-MD5' ) ) ) {
597
  return $ret;
598
  }
599
 
600
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
601
  return $challenge;
602
  }
603
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
604
  return $ret;
605
  }
606
 
611
  $digest = &Auth_SASL::factory('digestmd5');
612
  $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge, "localhost", "pop3" ));
613
 
614
+ if ( $this->PEAR->isError($error = $this->_send( $auth_str ) ) ) {
615
  return $error;
616
  }
617
 
618
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
619
  return $challenge;
620
  }
621
+ if( $this->PEAR->isError($ret=$this->_checkResponse($challenge) )){
622
  return $ret;
623
  }
624
  /*
626
  * subsequent authentication, so we just silently ignore it.
627
  */
628
 
629
+ if ( $this->PEAR->isError( $challenge = $this->_send("\r\n") ) ) {
630
  return $challenge ;
631
  }
632
 
633
+ if ( $this->PEAR->isError( $challenge = $this->_recvLn() ) ) {
634
  return $challenge;
635
  }
636
 
660
  if ($this->_state == NET_POP3_STATE_AUTHORISATION) {
661
 
662
  if (!empty($this->_timestamp)) {
663
+ if($this->PEAR->isError($data = $this->_sendCmd('APOP ' . $user . ' ' . md5($this->_timestamp . $pass)) ) ){
664
  return $data;
665
  }
666
  $this->_state = NET_POP3_STATE_TRANSACTION;
893
  function _cmdStat()
894
  {
895
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
896
+ if(!$this->PEAR->isError($data = $this->_sendCmd('STAT'))){
897
  sscanf($data, '+OK %d %d', $msg_num, $size);
898
  $this->_maildrop['num_msg'] = $msg_num;
899
  $this->_maildrop['size'] = $size;
917
  $return=array();
918
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
919
  if (!isset($msg_id)) {
920
+ if(!$this->PEAR->isError($data = $this->_sendCmd('LIST') )){
921
  $data = $this->_getMultiline();
922
  $data = explode("\r\n", $data);
923
  foreach ($data as $line) {
929
  return $return;
930
  }
931
  } else {
932
+ if(!$this->PEAR->isError($data = $this->_sendCmd('LIST ' . $msg_id))){
933
  if($data!=''){
934
  sscanf($data, '+OK %d %d', $msg_id, $size);
935
  return array('msg_id' => $msg_id, 'size' => $size);
953
  function _cmdRetr($msg_id)
954
  {
955
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
956
+ if(!$this->PEAR->isError($data = $this->_sendCmd('RETR ' . $msg_id) )){
957
  $data = $this->_getMultiline();
958
  return $data;
959
  }
987
  function _cmdNoop()
988
  {
989
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
990
+ if(!$this->PEAR->isError($data = $this->_sendCmd('NOOP'))){
991
  return true;
992
  }
993
  }
1003
  function _cmdRset()
1004
  {
1005
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1006
+ if(!$this->PEAR->isError($data = $this->_sendCmd('RSET'))){
1007
  return true;
1008
  }
1009
  }
1037
  {
1038
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1039
 
1040
+ if(!$this->PEAR->isError($data = $this->_sendCmd('TOP ' . $msg_id . ' ' . $num_lines))){
1041
  return $this->_getMultiline();
1042
  }
1043
  }
1056
  if ($this->_state == NET_POP3_STATE_TRANSACTION) {
1057
 
1058
  if (!isset($msg_id)) {
1059
+ if(!$this->PEAR->isError($data = $this->_sendCmd('UIDL') )){
1060
  $data = $this->_getMultiline();
1061
  $data = explode("\r\n", $data);
1062
  foreach ($data as $line) {
1095
  */
1096
  function _sendCmd($cmd)
1097
  {
1098
+ if ($this->PEAR->isError($result = $this->_send($cmd) )){
1099
  return $result ;
1100
  }
1101
 
1102
+ if ($this->PEAR->isError($data = $this->_recvLn() )){
1103
  return $data;
1104
  }
1105
 
1125
  function _getMultiline()
1126
  {
1127
  $data = '';
1128
+ while(!$this->PEAR->isError($tmp = $this->_recvLn() ) ) {
1129
  if($tmp == '.'){
1130
  return substr($data, 0, -2);
1131
  }
1170
  echo "C: $data\n";
1171
  }
1172
 
1173
+ if ($this->PEAR->isError($error = $this->_socket->writeLine($data))) {
1174
  return $this->_raiseError('Failed to write to socket: ' . $error->getMessage());
1175
  }
1176
  return true;
1188
  */
1189
  function _recvLn()
1190
  {
1191
+ if ($this->PEAR->isError( $lastline = $this->_socket->readLine( 8192 ) ) ) {
1192
  return $this->_raiseError('Failed to write to socket: ' . $this->lastline->getMessage() );
1193
  }
1194
  if($this->_debug){
inc/phpmailer/class.phpmailer.php CHANGED
@@ -526,7 +526,7 @@ class acymailingPHPMailer extends WYSIJA_OBJECT{
526
 
527
  if (!empty($this->Sender) && !(bool)ini_get('safe_mode')) {
528
  //shouldnot it be -f%s ?
529
- $params = sprintf("-oi -f %s", $this->Sender);
530
  $old_from = ini_get('sendmail_from');
531
  ini_set('sendmail_from', $this->Sender);
532
  if ($this->SingleTo === true && count($toArr) > 1) {
@@ -2156,4 +2156,4 @@ class acymailingPHPMailer extends WYSIJA_OBJECT{
2156
  return $dkimhdrs.$signed."\r\n";
2157
  }
2158
 
2159
- }
526
 
527
  if (!empty($this->Sender) && !(bool)ini_get('safe_mode')) {
528
  //shouldnot it be -f%s ?
529
+ $params = sprintf("-oi -f %s", escapeshellarg($this->Sender));
530
  $old_from = ini_get('sendmail_from');
531
  ini_set('sendmail_from', $this->Sender);
532
  if ($this->SingleTo === true && count($toArr) > 1) {
2156
  return $dkimhdrs.$signed."\r\n";
2157
  }
2158
 
2159
+ }
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: MailPoet Newsletters
4
  Plugin URI: http://www.mailpoet.com/
5
  Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. MailPoet is a sweet plugin maintained and supported with love.
6
- Version: 2.7.5
7
  Author: MailPoet
8
  Author URI: http://www.mailpoet.com/
9
  License: GPLv2 or later
3
  Plugin Name: MailPoet Newsletters
4
  Plugin URI: http://www.mailpoet.com/
5
  Description: Create and send newsletters or automated emails. Capture subscribers with a widget. Import and manage your lists. MailPoet is a sweet plugin maintained and supported with love.
6
+ Version: 2.7.6
7
  Author: MailPoet
8
  Author URI: http://www.mailpoet.com/
9
  License: GPLv2 or later
languages/wysija-newsletters-de_DE.mo CHANGED
Binary file
languages/wysija-newsletters-en_AU.mo CHANGED
Binary file
languages/wysija-newsletters-en_GB.mo CHANGED
Binary file
languages/wysija-newsletters-es_419.mo CHANGED
Binary file
languages/wysija-newsletters-es_ES.mo CHANGED
Binary file
languages/wysija-newsletters-fr_FR.mo CHANGED
Binary file
languages/wysija-newsletters-gl_ES.mo CHANGED
Binary file
languages/wysija-newsletters-it_IT.mo CHANGED
Binary file
languages/wysija-newsletters-nb_NO.mo CHANGED
Binary file
languages/wysija-newsletters-oc.mo CHANGED
Binary file
languages/wysija-newsletters-pt_PT.mo CHANGED
Binary file
languages/wysija-newsletters-ro_RO.mo CHANGED
Binary file
languages/wysija-newsletters-ru_RU.mo CHANGED
Binary file
languages/wysija-newsletters-sl_SI.mo CHANGED
Binary file
languages/wysija-newsletters-tr_TR.mo CHANGED
Binary file
languages/wysija-newsletters-zh_CN.mo CHANGED
Binary file
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: wysija
3
  Tags: newsletter, newsletters, email newsletter, email subscription, newsletter signup, post notification, autoresponder, newsletter alert, auto newsletter, automatic post notification, email newsletters, email signup, auto post notifications, newsletter widget, newsletter builder, subscribe widget, signup widget, email subscription, newsletter plugin, widget, subscription, emailing, mailpoet, wysija, mandrill, sendgrid
4
  Requires at least: 3.5
5
- Tested up to: 4.7
6
- Stable tag: 2.7.5
7
  Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
8
 
9
  == Description ==
@@ -132,6 +132,14 @@ Our [support site](http://support.mailpoet.com/) has plenty of articles and a ti
132
 
133
  == Changelog ==
134
 
 
 
 
 
 
 
 
 
135
  = 2.7.5 - 2016-08-18 =
136
  * Fixed subscription form widget
137
 
2
  Contributors: wysija
3
  Tags: newsletter, newsletters, email newsletter, email subscription, newsletter signup, post notification, autoresponder, newsletter alert, auto newsletter, automatic post notification, email newsletters, email signup, auto post notifications, newsletter widget, newsletter builder, subscribe widget, signup widget, email subscription, newsletter plugin, widget, subscription, emailing, mailpoet, wysija, mandrill, sendgrid
4
  Requires at least: 3.5
5
+ Tested up to: 4.7.1
6
+ Stable tag: 2.7.6
7
  Send newsletters post notifications or autoresponders from WordPress easily, and beautifully. Start to capture subscribers with our widget now.
8
 
9
  == Description ==
132
 
133
  == Changelog ==
134
 
135
+ = 2.7.6 - 2017-01-18 =
136
+ * Fixed post categories not being displayed in sent newsletters
137
+ * Fixed PHPMailer vulnerability
138
+ * Fixed PEAR POP3's usage of static methods
139
+ * Fixed direct manipulation of the $wp_filter global
140
+ * Fixed BBPress unsubscribe compatibility
141
+ * Added ElasticEmail unsubscribe tag
142
+
143
  = 2.7.5 - 2016-08-18 =
144
  * Fixed subscription form widget
145
 
views/back/campaigns.php CHANGED
@@ -2941,7 +2941,7 @@ class WYSIJA_view_back_campaigns extends WYSIJA_view_back {
2941
  '<li>'.__('What we’re working on',WYSIJA).'</li>' .
2942
  '<li>'.__('News from us, the team',WYSIJA).'</li>' .
2943
  '</ul>
2944
- <p>View an <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=1181&wysijap=subscriptions-3">an example blog post email</a> and <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=64&wysijap=subscriptions-2">an example newsletter</a>.</p>
2945
  </div>' .
2946
  '<div class="mpoet-update-subscribe-right">' .
2947
 
2941
  '<li>'.__('What we’re working on',WYSIJA).'</li>' .
2942
  '<li>'.__('News from us, the team',WYSIJA).'</li>' .
2943
  '</ul>
2944
+ <p>View <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=1181&wysijap=subscriptions-3">an example blog post email</a> and <a target="_blank" href="http://www.mailpoet.com/?wysija-page=1&controller=email&action=view&email_id=64&wysijap=subscriptions-2">an example newsletter</a>.</p>
2945
  </div>' .
2946
  '<div class="mpoet-update-subscribe-right">' .
2947