1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 02:32:42 +01:00

Changed MetaMta Body Parser to handle HTC mail application correctly

Summary: Added a regex to remove the text

Test Plan: Tested a few messages, from mail application them gmail, both seemed fine, will add unit tests

Reviewers: epriestley

Reviewed By: epriestley

CC: aran

Differential Revision: https://secure.phabricator.com/D2078
This commit is contained in:
John-Ashton Allen 2012-04-02 15:21:15 -07:00 committed by epriestley
parent 687e5c0962
commit 44e3b6883b
2 changed files with 20 additions and 2 deletions

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -42,6 +42,12 @@ final class PhabricatorMetaMTAEmailBodyParser {
'',
$body);
// HTC Mail application (mobile)
$body = preg_replace(
'/^\s*Sent from my HTC smartphone.*?/msU',
'',
$body);
return rtrim($body);
}

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -72,6 +72,18 @@ OKAY
-----Original Message-----
> ...
EOEMAIL
,
<<<EOEMAIL
OKAY
Sent from my HTC smartphone on the Now Network from Sprint!
-Reply message ----- From: "somebody (someone)" <
somebody@somewhere.com>
To: <somebody@somewhere.com>
Subject: Some Text Date: Mon, Apr 2, 2012 1:42 pm
> ...
EOEMAIL
);