Page MenuHomePhabricator

D12494.id29989.diff
No OneTemporary

D12494.id29989.diff

diff --git a/externals/mimemailparser/MimeMailParser.class.php b/externals/mimemailparser/MimeMailParser.class.php
--- a/externals/mimemailparser/MimeMailParser.class.php
+++ b/externals/mimemailparser/MimeMailParser.class.php
@@ -111,6 +111,14 @@
* @param $data String
*/
public function setText($data) {
+ // NOTE: This has been modified for Phabricator. If the input data does not
+ // end in a newline, Mailparse fails to include the last line in the mail
+ // body. This happens somewhere deep, deep inside the mailparse extension,
+ // so adding a newline here seems like the most straightforward fix.
+ if (!preg_match('/\n\z/', $data)) {
+ $data = $data."\n";
+ }
+
$this->resource = mailparse_msg_create();
// does not parse incrementally, fast memory hog might explode
mailparse_msg_parse($this->resource, $data);

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 19, 3:09 PM (10 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6907837
Default Alt Text
D12494.id29989.diff (865 B)

Event Timeline