おーぷんそーすで行こう-XREA- by hiro

トップページ > oscommerce(alter版) > emai.phpエラーの修正

≪ 定数定義バグの修正 | TOP | カレンダーのお休み記載 ≫

2006年09月06日

 ■  emai.phpエラーの修正

会員登録途中や買い物後の自動返信メールのプログラムを読み込む際エラーバグが出るのを修正しました。

1../includes/classes/email.php の496行目~

for ($i=0; $i<count($headers); $i++) {
if (is_array($headers[$i])) {
for ($j=0; $j<count($headers[$i]); $j++) {
if ($headers[$i][$j] != '') {
$xtra_headers[] = $headers[$i][$j];
}
}
}

if ($headers[$i] != '') {
$xtra_headers[] = $headers[$i];
}
}

if (!isset($xtra_headers)) {
$xtra_headers = array();
}

$this->headers = array_merge($this->headers, $xtra_headers);
$this->output = str_replace('<!--name-->', mb_convert_encoding(mb_convert_kana($to_name." 様", "KV"), 'ISO-2022-JP'), $this->output);

if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers), '-f' . STORE_OWNER_EMAIL_ADDRESS);
}
}



for ($i=0; $i if (is_array($headers[$i])) {
for ($j=0; $j if ($headers[$i][$j] != '') {
$xtra_headers[] = $headers[$i][$j];
}
}
}
if ($headers[$i] != '') {
$xtra_headers[] = $headers[$i];
}
}
if (!isset($xtra_headers)) {
$xtra_headers = array();
}
if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
}
}

に変更。

2../admin/includes/classes/email.php の482行目~

if ($subject != '') {
$subject = mb_encode_mimeheader(mb_convert_kana($subject, "KV"), 'ISO-2022-JP');
}
$to = ($to_name != '')
? ('"' . mb_encode_mimeheader(mb_convert_kana($to_name." 様", "KV"), 'ISO-2022-JP') . '" <' . $to_addr . '>')
: $to_addr;
$from = ($from_name != '')
? ('"' . mb_encode_mimeheader(mb_convert_kana($from_name, "KV"), 'ISO-2022-JP') . '" <' . $from_addr. '>')
: $from_addr;

if (is_string($headers)) {
$headers = explode($this->lf, trim($headers));
}

for ($i=0; $i if (is_array($headers[$i])) {
for ($j=0; $j if ($headers[$i][$j] != '') {
$xtra_headers[] = $headers[$i][$j];
}
}
}

if ($headers[$i] != '') {
$xtra_headers[] = $headers[$i];
}
}

if (!isset($xtra_headers)) {
$xtra_headers = array();
}

if (EMAIL_TRANSPORT == 'smtp') {
return mail($to_addr, $subject, $this->output, 'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
}
}



if ($subject != '')
$subject = '=?iso-2022-jp?B?' .
base64_encode(mb_convert_encoding($subject,'JIS','EUC')) . '?=';
$to = ($to_name != '')
? ('"' . mb_encode_mimeheader(mb_convert_encoding($to_name .
TEXT_KEISYOU_SAMA,'JIS','EUC')) . '" <' . $to_addr . '>')
: $to_addr;
$from = ($from_name != '')
? ('"' .
mb_encode_mimeheader(mb_convert_encoding($from_name,'JIS','EUC')) . '" <' .
$from_addr. '>')
: $from_addr;
if(is_string($headers))
$headers = explode($this->lf, trim($headers));
for($i=0; $i if(is_array($headers[$i]))
for($j=0; $j if($headers[$i][$j] != '')
$xtra_headers[] = $headers[$i][$j];
if($headers[$i] != '')
$xtra_headers[] = $headers[$i];
}
if(!isset($xtra_headers))
$xtra_headers = array();
if (EMAIL_TRANSPORT=="smtp") {
return mail(
$to_addr,
$subject,
$this->output,
'From: ' . $from . $this->lf . 'To: ' . $to . $this->lf . implode($this->lf, $this->headers) . $this->lf . implode($this->lf, $xtra_headers));
} else {
return mail($to, $subject, $this->output, 'From: '.$from.$this->lf.implode($this->lf, $this->headers).$this->lf.implode($this->lf, $xtra_headers));
}
}

に変更

2006年09月06日 11:02

トラックバック

このエントリーのトラックバックURL:
http://open.free-creator.com/mt-tb.cgi/131

コメント

コメントしてください




保存しますか?

(書式を変更するような一部のHTMLタグを使うことができます)

Copyright 2006-2010 © free-creator.com