Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent 🏢 in Outlook email <html> tag from getting converted to emoji #2706

Merged
merged 1 commit into from
Oct 12, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/bundles/CoreBundle/Helper/EmojiHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,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 @@ -1358,4 +1358,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',
];
}