Skip to content

Commit

Permalink
Merge pull request #2706 from alanhartless/bug-2440
Browse files Browse the repository at this point in the history
Prevent 🏢 in Outlook email <html> tag from getting converted to emoji
  • Loading branch information
escopecz committed Oct 12, 2016
2 parents 70b094f + 1b6ed7d commit f19e7b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/bundles/CoreBundle/Helper/EmojiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ private static function emojiConvert($text, $from, $to)
foreach ($maps as $useMap) {
$mapClass = "Mautic\\CoreBundle\\Helper\\EmojiMap\\{$useMap}EmojiMap";
$text = str_replace(array_keys($mapClass::$map), $mapClass::$map, $text);

if (isset($mapClass::$exceptions)) {
$text = str_replace(array_keys($mapClass::$exceptions), $mapClass::$exceptions, $text);
}
}

if ($to !== 'emoji') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1357,4 +1357,9 @@ class ShortToUnicodeEmojiMap
':woman-heart-woman:' => "\xf0\x9f\x91\xa9\xe2\x80\x8d\xe2\x9d\xa4\xef\xb8\x8f\xe2\x80\x8d\xf0\x9f\x91\xa9",
':woman-kiss-woman:' => "\xf0\x9f\x91\xa9\xe2\x80\x8d\xe2\x9d\xa4\xef\xb8\x8f\xe2\x80\x8d\xf0\x9f\x92\x8b\xe2\x80\x8d\xf0\x9f\x91\xa9",
];

public static $exceptions = [
// Outlook email rendering
"microsoft-com\xf0\x9f\x8f\xa2office" => 'microsoft-com:office:office',
];
}

0 comments on commit f19e7b9

Please sign in to comment.