From 2a7c4b3cbf6a8a75d941075ce6af29a916ab0402 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 18 Aug 2023 17:03:19 +0200 Subject: [PATCH] Revert "Fix the handling of mentions with and without leading @" This reverts commit f8439040815b5ab34fc3525a3937073430af4114. --- com.woltlab.wcf/templates/userBBCodeTag.tpl | 2 +- wcfsetup/install/files/acp/templates/userBBCodeTag.tpl | 2 +- wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php | 4 ---- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/com.woltlab.wcf/templates/userBBCodeTag.tpl b/com.woltlab.wcf/templates/userBBCodeTag.tpl index 369371df25..dbe32b29d2 100644 --- a/com.woltlab.wcf/templates/userBBCodeTag.tpl +++ b/com.woltlab.wcf/templates/userBBCodeTag.tpl @@ -1,6 +1,6 @@ {if $userProfile === null} {* user no longer exists, use plain output rather than using a broken link *} - {$username}{* no newline after the tag + @{$username}{* no newline after the tag *}{else} {@$userProfile->getFormattedUsername()}{* no newline after the tag *}{/if} diff --git a/wcfsetup/install/files/acp/templates/userBBCodeTag.tpl b/wcfsetup/install/files/acp/templates/userBBCodeTag.tpl index 369371df25..dbe32b29d2 100644 --- a/wcfsetup/install/files/acp/templates/userBBCodeTag.tpl +++ b/wcfsetup/install/files/acp/templates/userBBCodeTag.tpl @@ -1,6 +1,6 @@ {if $userProfile === null} {* user no longer exists, use plain output rather than using a broken link *} - {$username}{* no newline after the tag + @{$username}{* no newline after the tag *}{else} {@$userProfile->getFormattedUsername()}{* no newline after the tag *}{/if} diff --git a/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php b/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php index 0b0d4c290b..d96c4b5d2e 100644 --- a/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php +++ b/wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php @@ -21,10 +21,6 @@ final class UserBBCode extends AbstractBBCode */ public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser): string { - if (!\str_starts_with($content, "@")) { - $content = "@{$content}"; - } - $userID = (!empty($openingTag['attributes'][0])) ? \intval($openingTag['attributes'][0]) : 0; if (!$userID) { return "[user]{$content}[/user]"; -- 2.20.1