Page MenuHomePhabricator

D12349.diff
No OneTemporary

D12349.diff

diff --git a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
--- a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
+++ b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
@@ -135,9 +135,11 @@
$body);
// Mailbox seems to make an attempt to comply with the "standard" but
- // omits the leading newline and uses an em dash?
+ // omits the leading newline and uses an em dash. This may or may not have
+ // the trailing space, but it's unique enough that there's no real ambiguity
+ // in detecting it.
$body = preg_replace(
- "/\s*\xE2\x80\x94 \nSent from Mailbox\s*\z/su",
+ "/\s*\xE2\x80\x94\s*\nSent from Mailbox\s*\z/su",
'',
$body);
diff --git a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
--- a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
+++ b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
@@ -247,6 +247,13 @@
OKAY {$emdash}{$trailing_space}
Sent from Mailbox
EOMAIL
+,
+<<<EOMAIL
+OKAY
+
+{$emdash}
+Sent from Mailbox
+EOMAIL
);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 2:18 PM (1 w, 10 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7309359
Default Alt Text
D12349.diff (1 KB)

Event Timeline