Skip to content

Commit d0c97f6

Browse files
authored
Merge pull request #12 from srdjanmarjanovic/bug/761-outlook-2010-formatting-problem
Fix signature stripping in Outlook 2010.
2 parents c4a2be2 + fe7b04f commit d0c97f6

File tree

6 files changed

+2627
-5
lines changed

6 files changed

+2627
-5
lines changed

src/ActiveCollab/EmailReplyExtractor/Extractor/OutlookExtractor.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ public function stripSignature()
2020

2121
return;
2222
}
23-
24-
// Should signature be longer than 8 lines?
25-
if ($x > 8) {
26-
return;
27-
}
2823
}
2924
}
3025
}
@@ -41,6 +36,16 @@ protected function getAllMessageSplitters()
4136
]);
4237
}
4338

39+
/**
40+
* Process body text
41+
*/
42+
protected function processLines()
43+
{
44+
parent::processLines();
45+
$this->stripSignature();
46+
}
47+
48+
4449
/**
4550
* Strip default Outlook for Mac signature.
4651
*
@@ -51,6 +56,7 @@ protected function getAllMessageSplitters()
5156
public static function toPlainText($html)
5257
{
5358
$html = preg_replace('/<div id="MAC_OUTLOOK_SIGNATURE".+<\/div>/', '', $html);
59+
$html = preg_replace('/<link[^>]*>/i', '', $html);
5460

5561
return parent::toPlainText($html);
5662
}

0 commit comments

Comments
 (0)