Fix email headers when using long email subjects and \r\n as crlf.
diff --git a/system/libraries/Email.php b/system/libraries/Email.php
index 8fd7a79..b922cb1 100644
--- a/system/libraries/Email.php
+++ b/system/libraries/Email.php
@@ -1228,7 +1228,7 @@
// wrap each line with the shebang, charset, and transfer encoding
// the preceding space on successive lines is required for header "folding"
- return trim(preg_replace('/^(.*)$/m', ' =?'.$this->charset.'?Q?$1?=', $output.$temp));
+ return trim(preg_replace('/^(.*?)(\n|\r)*$/m', ' =?'.$this->charset.'?Q?$1?=$2', $output.$temp));
}
// --------------------------------------------------------------------