Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.

Commit 87391c4

Browse files
committed
insert HTML line breaks before all newlines
1 parent 35e1738 commit 87391c4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

files/lib/system/event/listener/WelcomeThreadEventListener.class.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,12 @@ protected function saved()
6060
$threadTitle = WCF::getLanguage()->get(WELCOME_THREAD_TITLE);
6161
$threadContent = WCF::getLanguage()->get(WELCOME_THREAD_CONTENT);
6262

63+
// insert HTML line breaks before all newlines
64+
$threadContent = \nl2br($threadContent, false);
65+
6366
// replace variables in title and content
6467
$threadTitle = \str_replace('{username}', $newUser->username, $threadTitle);
65-
$threadContent = \str_replace('{username}', $newUser->username, $threadContent);
68+
$threadContent = \str_replace('{username}', '@' . $newUser->username, $threadContent);
6669

6770
// get thread tags
6871
$threadTags = [];
@@ -86,7 +89,7 @@ protected function saved()
8689
'isDisabled' => WELCOME_THREAD_DISABLE
8790
],
8891
'postData' => [
89-
'message' => $threadContent
92+
'message' => $htmlInputProcessor->getHtml()
9093
],
9194
'tags' => $threadTags,
9295
'subscribeThread' => false,

0 commit comments

Comments
 (0)