• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

XOOPS Cube Legacy base repository


Commit MetaInfo

Revision6b02210535a6f868a38a528d98eb13966bb0d65d (tree)
Zeit2013-02-23 14:16:05
AutorHIKAWA Kilica <kilica.hikawa@gmai...>
CommiterHIKAWA Kilica

Log Message

Merge pull request #48 from nao-pon/xoopscube_mailer_patch

fix send mail with safe mode (phpmailer patch)

Ändern Zusammenfassung

Diff

--- a/html/class/mail/phpmailer/class.phpmailer.php
+++ b/html/class/mail/phpmailer/class.phpmailer.php
@@ -741,7 +741,8 @@ class PHPMailer {
741741 } else {
742742 $params = sprintf("-oi -f %s", $this->Sender);
743743 }
744- if ($this->Sender != '' and !ini_get('safe_mode')) {
744+ $isSafeMode = !!ini_get('safe_mode');
745+ if ($this->Sender != '' and !$isSafeMode) {
745746 $old_from = ini_get('sendmail_from');
746747 ini_set('sendmail_from', $this->Sender);
747748 if ($this->SingleTo === true && count($toArr) > 1) {
@@ -760,13 +761,21 @@ class PHPMailer {
760761 } else {
761762 if ($this->SingleTo === true && count($toArr) > 1) {
762763 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+ }
764769 // implement call back function if it exists
765770 $isSent = ($rt == 1) ? 1 : 0;
766771 $this->doCallback($isSent, $val, $this->cc, $this->bcc, $this->Subject, $body);
767772 }
768773 } 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+ }
770779 // implement call back function if it exists
771780 $isSent = ($rt == 1) ? 1 : 0;
772781 $this->doCallback($isSent, $to, $this->cc, $this->bcc, $this->Subject, $body);