Fix #3365: Legacy richtext emojis not parsed in richtext preview

This commit is contained in:
buddh4 2018-11-15 13:30:23 +01:00
parent 85ade5aed2
commit 6a3f500f51
2 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ HumHub Change Log
- Fix #3359: Weekly summary e-mails are not sent in default configuration
- Fix: Space module permission configuration of non installed space modules visible in permission grid
- Fix #3365: Legacy richtext emojis not parsed in richtext preview
1.3.7 (October 23, 2018)

View File

@ -189,11 +189,12 @@ class ProsemirrorRichText extends AbstractRichText
protected function toUTF8Emoji($text)
{
return preg_replace_callback('/:(([A-Za-z0-9])+):/', function($match) {
// Note the ; was used in the legacy editor
return preg_replace_callback('/[:|;](([A-Za-z0-9])+)[:|;]/', function($match) {
$result = $match[0];
if(isset($match[1])) {
$result = array_key_exists($match[1], EmojiMap::MAP) ? EmojiMap::MAP[$match[1]] : $result;
$result = array_key_exists(strtolower($match[1]), EmojiMap::MAP) ? EmojiMap::MAP[strtolower($match[1])] : $result;
}
return $result;