Permalink
Browse files

[extras:lng:ja] use XCUBE_MAILERLOCAL_MAIL_LE in mailer

For issue xoopscube#104

XoopsMailerLocal use `XCUBE_MAILERLOCAL_MAIL_LE` if it defined.

If you would like to specify the line feed code of Subject passed to
mail() in a XoopsMailerLocal class, it is necessary to define constant
`XCUBE_MAILERLOCAL_MAIL_LE` .

The example of preload (XoopsMailerLocalSetLE.class.php)
```php
<?php
define('XCUBE_MAILERLOCAL_MAIL_LE', "\n");
```
  • Loading branch information...
nao-pon committed Jun 7, 2014
1 parent 94a3cdd commit b1c211daa0edd5e781c905aa0735e40a3f0c8ffe
@@ -137,7 +137,7 @@ function EncodeHeader ($str, $position = 'text', $force=false) {
if ($this->needs_encode || $force) {
$enc = mb_internal_encoding();
mb_internal_encoding('ISO-2022-JP');
$eol = $this->Mailer=='mail'?"\r\n":"\n"; // XXX: this for bugs in PHP mail() subject with linefeed handling
$eol = $this->Mailer=='mail'?(defined('XCUBE_MAILERLOCAL_MAIL_LE')?XCUBE_MAILERLOCAL_MAIL_LE:"\r\n"):"\n"; // XXX: this for bugs in PHP mail() subject with linefeed handling
$encoded = mb_encode_mimeheader($str, 'ISO-2022-JP', 'B', $eol, 9); // offset strlen("Subject: ") as 9
mb_internal_encoding($enc);
} else {
@@ -137,7 +137,7 @@ function EncodeHeader ($str, $position = 'text', $force=false) {
if ($this->needs_encode || $force) {
$enc = mb_internal_encoding();
mb_internal_encoding('ISO-2022-JP');
$eol = $this->Mailer=='mail'?"\r\n":"\n"; // XXX: this for bugs in PHP mail() subject with linefeed handling
$eol = $this->Mailer=='mail'?(defined('XCUBE_MAILERLOCAL_MAIL_LE')?XCUBE_MAILERLOCAL_MAIL_LE:"\r\n"):"\n"; // XXX: this for bugs in PHP mail() subject with linefeed handling
$encoded = mb_encode_mimeheader($str, 'ISO-2022-JP', 'B', $eol, 9); // offset strlen("Subject: ") as 9
mb_internal_encoding($enc);
} else {

0 comments on commit b1c211d

Please sign in to comment.