0
0
mirror of https://github.com/PHPMailer/PHPMailer.git synced 2024-09-20 18:03:04 +02:00
This commit is contained in:
Jim Jagielski 2017-10-30 18:54:06 -04:00
commit e03ba97962

View File

@ -962,7 +962,10 @@ class PHPMailer
$pos = strrpos($address, '@'); $pos = strrpos($address, '@');
if (false === $pos) { if (false === $pos) {
// At-sign is missing. // At-sign is missing.
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; $error_message = sprintf('%s (%s): %s',
$this->lang('invalid_address'),
$kind,
$address);
$this->setError($error_message); $this->setError($error_message);
$this->edebug($error_message); $this->edebug($error_message);
if ($this->exceptions) { if ($this->exceptions) {
@ -1010,7 +1013,9 @@ class PHPMailer
protected function addAnAddress($kind, $address, $name = '') protected function addAnAddress($kind, $address, $name = '')
{ {
if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) { if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {
$error_message = $this->lang('Invalid recipient kind: ') . $kind; $error_message = sprintf('%s: %s',
$this->lang('Invalid recipient kind'),
$kind);
$this->setError($error_message); $this->setError($error_message);
$this->edebug($error_message); $this->edebug($error_message);
if ($this->exceptions) { if ($this->exceptions) {
@ -1020,7 +1025,10 @@ class PHPMailer
return false; return false;
} }
if (!static::validateAddress($address)) { if (!static::validateAddress($address)) {
$error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; $error_message = sprintf('%s (%s): %s',
$this->lang('invalid_address'),
$kind,
$address);
$this->setError($error_message); $this->setError($error_message);
$this->edebug($error_message); $this->edebug($error_message);
if ($this->exceptions) { if ($this->exceptions) {
@ -1126,7 +1134,9 @@ class PHPMailer
if (false === $pos or if (false === $pos or
(!$this->has8bitChars(substr($address, ++$pos)) or !static::idnSupported()) and (!$this->has8bitChars(substr($address, ++$pos)) or !static::idnSupported()) and
!static::validateAddress($address)) { !static::validateAddress($address)) {
$error_message = $this->lang('invalid_address') . " (setFrom) $address"; $error_message = sprintf('%s (From): %s',
$this->lang('invalid_address'),
$address);
$this->setError($error_message); $this->setError($error_message);
$this->edebug($error_message); $this->edebug($error_message);
if ($this->exceptions) { if ($this->exceptions) {
@ -1376,7 +1386,10 @@ class PHPMailer
} }
$this->$address_kind = $this->punyencodeAddress($this->$address_kind); $this->$address_kind = $this->punyencodeAddress($this->$address_kind);
if (!static::validateAddress($this->$address_kind)) { if (!static::validateAddress($this->$address_kind)) {
$error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind; $error_message = sprintf('%s (%s): %s',
$this->lang('invalid_address'),
$address_kind,
$this->$address_kind);
$this->setError($error_message); $this->setError($error_message);
$this->edebug($error_message); $this->edebug($error_message);
if ($this->exceptions) { if ($this->exceptions) {