From c830d9c54e829963105ad2118865f86da49f7979 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Sun, 9 Sep 2018 23:48:02 +0200 Subject: Correct regex replace strings --- core/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/functions.php b/core/functions.php index 558acf2..1e786ed 100644 --- a/core/functions.php +++ b/core/functions.php @@ -184,7 +184,7 @@ function getEmoticons(): array { function parseEmoticons($string): string { foreach(getEmoticons() as $emoticon => $data) { $pattern = '#(^|\s)'.preg_quote($emoticon).'#'; - $replace = " {$data[0]}"; + $replace = "\\1{$data[0]}"; $string = preg_replace($pattern, $replace, $string); } @@ -222,7 +222,7 @@ function getUnicodeEmoticons(): array { function parseUnicodeEmoticons($string): string { foreach(getUnicodeEmoticons() as $emoticon => $explanation) { $pattern = '#(^|\s)'.preg_quote($emoticon).'#'; - $replace = " {$emoticon}"; + $replace = "\\1{$emoticon}"; $string = preg_replace($pattern, $replace, $string); } -- cgit v1.2.3