From 7dc3e8965d33ec4e1986b618f22e302fe9fcebe4 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Tue, 14 Dec 2021 15:28:35 +0300 Subject: [PATCH] Wall: Ability to ping users by short adresses Fixes #28 --- Web/Models/Entities/Traits/TRichText.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Web/Models/Entities/Traits/TRichText.php b/Web/Models/Entities/Traits/TRichText.php index b358bdc9..76d9ba25 100644 --- a/Web/Models/Entities/Traits/TRichText.php +++ b/Web/Models/Entities/Traits/TRichText.php @@ -59,9 +59,9 @@ trait TRichText if($proc) { $rel = $this->isAd() ? "sponsored" : "ugc"; $text = $this->formatLinks($text); - $text = preg_replace("%@(id|club)([0-9]++) \(([\p{L} 0-9]+)\)%Xu", "[$1$2|$3]", $text); - $text = preg_replace("%@(id|club)([0-9]++)%Xu", "[$1$2|@$1$2]", $text); - $text = preg_replace("%\[(id|club)([0-9]++)\|([\p{L} 0-9@]+)\]%Xu", "$3", $text); + $text = preg_replace("%@([A-Za-z0-9]++) \(([\p{L} 0-9]+)\)%Xu", "[$1|$2]", $text); + $text = preg_replace("%@([A-Za-z0-9]++)%Xu", "[$1|@$1]", $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 = $this->formatEmojis($text); }