diff --git a/lib/Cake/Network/CakeEmail.php b/lib/Cake/Network/CakeEmail.php
index 41f028269..7412b26fa 100644
--- a/lib/Cake/Network/CakeEmail.php
+++ b/lib/Cake/Network/CakeEmail.php
@@ -889,7 +889,7 @@ class CakeEmail {
$line = '.' . $line;
}
if (!preg_match('/\<[a-z]/i', $line)) {
- $formatted = array_merge($formatted, explode("\n", wordwrap($line, self::LINE_LENGTH_SHOULD, "\n", true)));
+ $formatted = array_merge($formatted, explode("\n", wordwrap($line, self::LINE_LENGTH_SHOULD, "\n")));
continue;
}
diff --git a/lib/Cake/tests/Case/Network/CakeEmailTest.php b/lib/Cake/tests/Case/Network/CakeEmailTest.php
index ab568a5d3..46a8ea3f6 100644
--- a/lib/Cake/tests/Case/Network/CakeEmailTest.php
+++ b/lib/Cake/tests/Case/Network/CakeEmailTest.php
@@ -509,6 +509,26 @@ class CakeEmailTest extends CakeTestCase {
''
);
$this->assertIdentical($result, $expected);
+
+ $text = 'Lorem ipsum ok';
+ $result = $this->CakeEmail->wrap($text);
+ $expected = array(
+ 'Lorem ipsum',
+ '',
+ 'ok',
+ ''
+ );
+ $this->assertIdentical($result, $expected);
+
+ $text = 'Lorem ipsum withonewordverybigMorethanthelineshouldsizeofrfcspecificationbyieeeavailableonieeesite ok.';
+ $result = $this->CakeEmail->wrap($text);
+ $expected = array(
+ 'Lorem ipsum',
+ 'withonewordverybigMorethanthelineshouldsizeofrfcspecificationbyieeeavailableonieeesite',
+ 'ok.',
+ ''
+ );
+ $this->assertIdentical($result, $expected);
}
}