XOOPS Cube Legacy base repository
Revision | 6b02210535a6f868a38a528d98eb13966bb0d65d (tree) |
---|---|
Zeit | 2013-02-23 14:16:05 |
Autor | HIKAWA Kilica <kilica.hikawa@gmai...> |
Commiter | HIKAWA Kilica |
Merge pull request #48 from nao-pon/xoopscube_mailer_patch
fix send mail with safe mode (phpmailer patch)
@@ -741,7 +741,8 @@ class PHPMailer { | ||
741 | 741 | } else { |
742 | 742 | $params = sprintf("-oi -f %s", $this->Sender); |
743 | 743 | } |
744 | - if ($this->Sender != '' and !ini_get('safe_mode')) { | |
744 | + $isSafeMode = !!ini_get('safe_mode'); | |
745 | + if ($this->Sender != '' and !$isSafeMode) { | |
745 | 746 | $old_from = ini_get('sendmail_from'); |
746 | 747 | ini_set('sendmail_from', $this->Sender); |
747 | 748 | if ($this->SingleTo === true && count($toArr) > 1) { |
@@ -760,13 +761,21 @@ class PHPMailer { | ||
760 | 761 | } else { |
761 | 762 | if ($this->SingleTo === true && count($toArr) > 1) { |
762 | 763 | foreach ($toArr as $key => $val) { |
763 | - $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); | |
764 | + if ($isSafeMode) { | |
765 | + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); | |
766 | + } else { | |
767 | + $rt = @mail($val, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); | |
768 | + } | |
764 | 769 | // implement call back function if it exists |
765 | 770 | $isSent = ($rt == 1) ? 1 : 0; |
766 | 771 | $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body); |
767 | 772 | } |
768 | 773 | } else { |
769 | - $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); | |
774 | + if ($isSafeMode) { | |
775 | + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header); | |
776 | + } else { | |
777 | + $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, $params); | |
778 | + } | |
770 | 779 | // implement call back function if it exists |
771 | 780 | $isSent = ($rt == 1) ? 1 : 0; |
772 | 781 | $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body); |