From 95de8e4514768db4db972c53971e7e405550166c Mon Sep 17 00:00:00 2001 From: Maxim Leshchenko Date: Tue, 8 Feb 2022 18:28:51 +0200 Subject: [PATCH] Wall: Process hashtags only if it's not part of a word Closes #449 --- Web/Models/Entities/Traits/TRichText.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Web/Models/Entities/Traits/TRichText.php b/Web/Models/Entities/Traits/TRichText.php index 07caacdc..3eaaeaff 100644 --- a/Web/Models/Entities/Traits/TRichText.php +++ b/Web/Models/Entities/Traits/TRichText.php @@ -64,7 +64,7 @@ trait TRichText $text = preg_replace("%@([A-Za-z0-9]++) \(([\p{L} 0-9]+)\)%Xu", "[$1|$2]", $text); $text = preg_replace("%([\n\r\s]|^)(@([A-Za-z0-9]++))%Xu", "$1[$3|@$3]", $text); $text = preg_replace("%\[([A-Za-z0-9]++)\|([\p{L} 0-9@]+)\]%Xu", "$2", $text); - $text = preg_replace("%(#([\p{L}_-]++[0-9]*[\p{L}_-]*))%Xu", "$1", $text); + $text = preg_replace("%([\n\r\s]|^)(#([\p{L}_-]++[0-9]*[\p{L}_-]*))%Xu", "$1$2", $text); $text = $this->formatEmojis($text); }