Skip to content

Commit

Permalink
[xoopsmailerlocal] filtering by secureHeader at function addrFormat()
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Jul 12, 2015
1 parent fac357a commit 3bfef36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions html/language/ja_utf8/xoopsmailerlocal.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,18 @@ function XoopsMultiMailerLocal() {
}
}

function AddrFormat($addr) {
function addrFormat($addr) {
if(empty($addr[1])) {
$formatted = $addr[0];
$formatted = $this->secureHeader($addr[0]);
} else {
$formatted = $this->EncodeHeader($addr[1], 'text') . " <" .
$addr[0] . ">";
$formatted = $this->EncodeHeader($this->secureHeader($addr[1]), 'text') . ' <' . $this->secureHeader(
$addr[0]
) . '>';
}
return $formatted;
}

function EncodeHeader ($str, $position = 'text', $force=false) {
function encodeHeader ($str, $position = 'text', $force=false) {
if (version_compare(PHP_VERSION, '4.4.1')>0) {
if (function_exists('mb_convert_encoding')) { //Use mb_string extension if exists.
if ($this->needs_encode || $force) {
Expand Down
13 changes: 7 additions & 6 deletions html/language/japanese/xoopsmailerlocal.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: xoopsmailerlocal.php,v 1.4 2008/07/05 07:45:33 minahito Exp $
// $Id: xoopsmailerlocal.php,v 1.2 2008/09/21 06:36:10 minahito Exp $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System //
// Copyright (c) 2000 XOOPS.org //
Expand Down Expand Up @@ -121,17 +121,18 @@ function XoopsMultiMailerLocal() {
}
}

function AddrFormat($addr) {
function addrFormat($addr) {
if(empty($addr[1])) {
$formatted = $addr[0];
$formatted = $this->secureHeader($addr[0]);
} else {
$formatted = $this->EncodeHeader($addr[1], 'text') . " <" .
$addr[0] . ">";
$formatted = $this->EncodeHeader($this->secureHeader($addr[1]), 'text') . ' <' . $this->secureHeader(
$addr[0]
) . '>';
}
return $formatted;
}

function EncodeHeader ($str, $position = 'text', $force=false) {
function encodeHeader ($str, $position = 'text', $force=false) {
if (version_compare(PHP_VERSION, '4.4.1')>0) {
if (function_exists('mb_convert_encoding')) { //Use mb_string extension if exists.
if ($this->needs_encode || $force) {
Expand Down

0 comments on commit 3bfef36

Please sign in to comment.