mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Add another pattern to quoted email body stripping
Summary: Ref T3217. @hlau has an email client which quotes text with: ________________________________________ From: ... Add a regular expression to correctly detect this as quoted body text. Test Plan: Add unit test; executed unit test. Reviewers: btrahan, chad Reviewed By: chad CC: hlau, aran Maniphest Tasks: T3217 Differential Revision: https://secure.phabricator.com/D5986
This commit is contained in:
parent
bb45f5eff5
commit
80024f051e
3 changed files with 17 additions and 7 deletions
|
@ -1118,8 +1118,8 @@ phutil_register_library_map(array(
|
||||||
'PhabricatorMetaMTAConfigOptions' => 'applications/config/option/PhabricatorMetaMTAConfigOptions.php',
|
'PhabricatorMetaMTAConfigOptions' => 'applications/config/option/PhabricatorMetaMTAConfigOptions.php',
|
||||||
'PhabricatorMetaMTAController' => 'applications/metamta/controller/PhabricatorMetaMTAController.php',
|
'PhabricatorMetaMTAController' => 'applications/metamta/controller/PhabricatorMetaMTAController.php',
|
||||||
'PhabricatorMetaMTADAO' => 'applications/metamta/storage/PhabricatorMetaMTADAO.php',
|
'PhabricatorMetaMTADAO' => 'applications/metamta/storage/PhabricatorMetaMTADAO.php',
|
||||||
'PhabricatorMetaMTAEmailBodyParser' => 'applications/metamta/PhabricatorMetaMTAEmailBodyParser.php',
|
'PhabricatorMetaMTAEmailBodyParser' => 'applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php',
|
||||||
'PhabricatorMetaMTAEmailBodyParserTestCase' => 'applications/metamta/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php',
|
'PhabricatorMetaMTAEmailBodyParserTestCase' => 'applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php',
|
||||||
'PhabricatorMetaMTAListController' => 'applications/metamta/controller/PhabricatorMetaMTAListController.php',
|
'PhabricatorMetaMTAListController' => 'applications/metamta/controller/PhabricatorMetaMTAListController.php',
|
||||||
'PhabricatorMetaMTAMail' => 'applications/metamta/storage/PhabricatorMetaMTAMail.php',
|
'PhabricatorMetaMTAMail' => 'applications/metamta/storage/PhabricatorMetaMTAMail.php',
|
||||||
'PhabricatorMetaMTAMailBody' => 'applications/metamta/view/PhabricatorMetaMTAMailBody.php',
|
'PhabricatorMetaMTAMailBody' => 'applications/metamta/view/PhabricatorMetaMTAMailBody.php',
|
||||||
|
@ -2293,11 +2293,7 @@ phutil_register_library_map(array(
|
||||||
'DivinerFileAtomizer' => 'DivinerAtomizer',
|
'DivinerFileAtomizer' => 'DivinerAtomizer',
|
||||||
'DivinerGenerateWorkflow' => 'DivinerWorkflow',
|
'DivinerGenerateWorkflow' => 'DivinerWorkflow',
|
||||||
'DivinerListController' => 'PhabricatorController',
|
'DivinerListController' => 'PhabricatorController',
|
||||||
'DivinerLiveAtom' =>
|
'DivinerLiveAtom' => 'DivinerDAO',
|
||||||
array(
|
|
||||||
0 => 'DivinerDAO',
|
|
||||||
1 => 'PhabricatorPolicyInterface',
|
|
||||||
),
|
|
||||||
'DivinerLiveBook' =>
|
'DivinerLiveBook' =>
|
||||||
array(
|
array(
|
||||||
0 => 'DivinerDAO',
|
0 => 'DivinerDAO',
|
||||||
|
|
|
@ -24,6 +24,12 @@ final class PhabricatorMetaMTAEmailBodyParser {
|
||||||
'',
|
'',
|
||||||
$body);
|
$body);
|
||||||
|
|
||||||
|
// See example in T3217.
|
||||||
|
$body = preg_replace(
|
||||||
|
'/^________________________________________\s+From:.*?/imsU',
|
||||||
|
'',
|
||||||
|
$body);
|
||||||
|
|
||||||
return rtrim($body);
|
return rtrim($body);
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,14 @@ OKAY
|
||||||
|
|
||||||
Sent from my iPhone
|
Sent from my iPhone
|
||||||
EOEMAIL
|
EOEMAIL
|
||||||
|
,
|
||||||
|
<<<EOMAIL
|
||||||
|
OKAY
|
||||||
|
|
||||||
|
________________________________________
|
||||||
|
From: Abraham Lincoln <alincoln@logcab.in>
|
||||||
|
Subject: Core World Tariffs
|
||||||
|
EOMAIL
|
||||||
,
|
,
|
||||||
);
|
);
|
||||||
}
|
}
|
Loading…
Reference in a new issue