Permalink
Browse files

Applying patch from 'Mark Mitchell' fixes issues with sending Email v…

…ia smtp. Which were incorrect based on previous patches given for ticket #1100.

Fixes #1205, Fixes #1204
  • Loading branch information...
1 parent 3f6bee0 commit 48c2c16ebca19078593a64aa244d1802da8294f0 @markstory markstory committed Oct 19, 2010
@@ -619,9 +619,9 @@ function __encode($subject) {
function __formatAddress($string, $smtp = false) {
$hasAlias = preg_match('/((.*)\s)?<(.+)>/', $string, $matches);
if ($smtp && $hasAlias) {
- return $this->__strip(' <' . $matches[3] . '>');
+ return $this->__strip('<' . $matches[3] . '>');
} elseif ($smtp) {
- return $this->__strip(' <' . $string . '>');
+ return $this->__strip('<' . $string . '>');
}
if ($hasAlias && !empty($matches[2])) {
return $this->__strip($matches[2] . ' <' . $matches[3] . '>');
@@ -796,4 +796,4 @@ function __debug() {
}
}
-?>
+?>
@@ -694,13 +694,13 @@ function testFormatAddressAliases() {
$this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('email@example.com', true);
- $this->assertEqual($result, ' <email@example.com>');
+ $this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('<email@example.com>', true);
- $this->assertEqual($result, ' <email@example.com>');
+ $this->assertEqual($result, '<email@example.com>');
$result = $this->Controller->EmailTest->formatAddress('alias name <email@example.com>', true);
- $this->assertEqual($result, ' <email@example.com>');
+ $this->assertEqual($result, '<email@example.com>');
}
}
?>

0 comments on commit 48c2c16

Please sign in to comment.