Skip to content

Commit

Permalink
Revert "Fix the handling of mentions with and without leading @"
Browse files Browse the repository at this point in the history
This reverts commit f843904.
  • Loading branch information
dtdesign committed Aug 18, 2023
1 parent f843904 commit 2a7c4b3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion com.woltlab.wcf/templates/userBBCodeTag.tpl
Original file line number Diff line number Diff line change
@@ -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}
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{@$userProfile->userID}">{@$userProfile->getFormattedUsername()}</a>{* no newline after the tag
*}{/if}
2 changes: 1 addition & 1 deletion wcfsetup/install/files/acp/templates/userBBCodeTag.tpl
Original file line number Diff line number Diff line change
@@ -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}
<a href="{link controller='User' object=$userProfile->getDecoratedObject()}{/link}" class="userMention userLink" data-object-id="{@$userProfile->userID}">{@$userProfile->getFormattedUsername()}</a>{* no newline after the tag
*}{/if}
4 changes: 0 additions & 4 deletions wcfsetup/install/files/lib/system/bbcode/UserBBCode.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]";
Expand Down

0 comments on commit 2a7c4b3

Please sign in to comment.