Skip to content

Commit 17d6890

Browse files
committed
Apply changes to ArticleCommentManager and PageCommentManager
1 parent ee7f84d commit 17d6890

4 files changed

Lines changed: 37 additions & 52 deletions

File tree

wcfsetup/install/files/lib/system/comment/manager/ArticleCommentManager.class.php

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -190,22 +190,18 @@ public function prepare(array $likes)
190190
) {
191191
$like->setIsAccessible();
192192

193-
// short output
194-
$text = WCF::getLanguage()->getDynamicVariable(
193+
$like->setTitle(WCF::getLanguage()->getDynamicVariable(
195194
'wcf.like.title.com.woltlab.wcf.articleComment',
196195
[
197196
'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
198197
'comment' => $comment,
199198
'articleContent' => $articleContents[$comment->objectID],
200199
'reaction' => $like,
201-
// @deprecated 5.3 Use `$reaction` instead
202-
'like' => $like,
200+
'author' => $like->getUserProfile(),
203201
]
204-
);
205-
$like->setTitle($text);
206-
207-
// output
208-
$like->setDescription($comment->getExcerpt());
202+
));
203+
$like->setLink($comment->getLink());
204+
$like->setDescription(\strip_tags($comment->getExcerpt()));
209205
}
210206
}
211207
} else {
@@ -220,23 +216,18 @@ public function prepare(array $likes)
220216
) {
221217
$like->setIsAccessible();
222218

223-
// short output
224-
$text = WCF::getLanguage()->getDynamicVariable(
219+
$like->setTitle(WCF::getLanguage()->getDynamicVariable(
225220
'wcf.like.title.com.woltlab.wcf.articleComment.response',
226221
[
227-
'responseAuthor' => $comment->userID ? $users[$response->userID] : null,
222+
'responseAuthor' => $response->userID ? $users[$response->userID] : null,
228223
'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
229224
'articleContent' => $articleContents[$comment->objectID],
230225
'reaction' => $like,
231-
// @deprecated 5.3 Use `$reaction` instead
232-
'like' => $like,
233-
'response' => $response,
226+
'author' => $like->getUserProfile(),
234227
]
235-
);
236-
$like->setTitle($text);
237-
238-
// output
239-
$like->setDescription($response->getExcerpt());
228+
));
229+
$like->setLink($response->getLink());
230+
$like->setDescription(\strip_tags($response->getExcerpt()));
240231
}
241232
}
242233
}

wcfsetup/install/files/lib/system/comment/manager/PageCommentManager.class.php

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,18 @@ public function prepare(array $likes)
177177
if (isset($pages[$comment->objectID]) && $pages[$comment->objectID]->isAccessible()) {
178178
$like->setIsAccessible();
179179

180-
// short output
181-
$text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.pageComment', [
182-
'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
183-
'comment' => $comment,
184-
'page' => $pages[$comment->objectID],
185-
'reaction' => $like,
186-
// @deprecated 5.3 Use `$reaction` instead
187-
'like' => $like,
188-
]);
189-
$like->setTitle($text);
190-
191-
// output
192-
$like->setDescription($comment->getExcerpt());
180+
$like->setTitle(WCF::getLanguage()->getDynamicVariable(
181+
'wcf.like.title.com.woltlab.wcf.pageComment',
182+
[
183+
'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
184+
'comment' => $comment,
185+
'page' => $pages[$comment->objectID],
186+
'reaction' => $like,
187+
'author' => $like->getUserProfile(),
188+
]
189+
));
190+
$like->setLink($comment->getLink());
191+
$like->setDescription(\strip_tags($comment->getExcerpt()));
193192
}
194193
}
195194
} else {
@@ -201,23 +200,18 @@ public function prepare(array $likes)
201200
if (isset($pages[$comment->objectID]) && $pages[$comment->objectID]->isAccessible()) {
202201
$like->setIsAccessible();
203202

204-
// short output
205-
$text = WCF::getLanguage()->getDynamicVariable(
203+
$like->setTitle(WCF::getLanguage()->getDynamicVariable(
206204
'wcf.like.title.com.woltlab.wcf.pageComment.response',
207205
[
208-
'responseAuthor' => $comment->userID ? $users[$response->userID] : null,
206+
'responseAuthor' => $response->userID ? $users[$response->userID] : null,
209207
'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
210208
'page' => $pages[$comment->objectID],
211209
'reaction' => $like,
212-
// @deprecated 5.3 Use `$reaction` instead
213-
'like' => $like,
214-
'response' => $response,
210+
'author' => $like->getUserProfile(),
215211
]
216-
);
217-
$like->setTitle($text);
218-
219-
// output
220-
$like->setDescription($response->getExcerpt());
212+
));
213+
$like->setLink($response->getLink());
214+
$like->setDescription(\strip_tags($response->getExcerpt()));
221215
}
222216
}
223217
}

wcfsetup/install/lang/de.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4226,10 +4226,10 @@ Erlaubte Dateiendungen: gif, jpg, jpeg, png, webp]]></item>
42264226
<item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf den Kommentar {if $commentAuthor}von <strong>{$commentAuthor->username}</strong>{else}eines Gasts{/if} an der Pinnwand von <strong>{$user->username}</strong> reagiert.]]></item>
42274227
<item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf die Antwort {if $responseAuthor}von <strong>{$responseAuthor->username}</strong>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <strong{$commentAuthor->username}</strong>{else}eines Gasts{/if} an der Pinnwand von <strong>{$user->username}</strong> reagiert.]]></item>
42284228
<item name="wcf.like.objectType.com.woltlab.wcf.likeableArticle"><![CDATA[Artikel]]></item>
4229-
<item name="wcf.like.title.com.woltlab.wcf.articleComment"><![CDATA[Hat mit {@$reaction->render()} auf den Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}eines Gasts{/if} zum Artikel <a href="{$comment->getLink()}">{$articleContent->getTitle()}</a> reagiert.]]></item>
4230-
<item name="wcf.like.title.com.woltlab.wcf.articleComment.response"><![CDATA[Hat mit {@$reaction->render()} auf die Antwort {if $responseAuthor}von <a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}eines Gasts{/if} zum Artikel <a href="{$response->getLink()}">{$articleContent->getTitle()}</a> reagiert.]]></item>
4231-
<item name="wcf.like.title.com.woltlab.wcf.pageComment"><![CDATA[Hat mit {@$reaction->render()} auf den Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}eines Gasts{/if} zu der Seite <a href="{$comment->getLink()}">{$page->getTitle()}</a> reagiert.]]></item>
4232-
<item name="wcf.like.title.com.woltlab.wcf.pageComment.response"><![CDATA[Hat mit {@$reaction->render()} auf die Antwort {if $responseAuthor}von <a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}eines Gasts{/if} zu der Seite <a href="{$response->getLink()}">{$page->getTitle()}</a> reagiert.]]></item>
4229+
<item name="wcf.like.title.com.woltlab.wcf.articleComment"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf den Kommentar {if $commentAuthor}von <strong>{$commentAuthor->username}</strong>{else}eines Gasts{/if} zum Artikel <strong>{$articleContent->getTitle()}</strong> reagiert.]]></item>
4230+
<item name="wcf.like.title.com.woltlab.wcf.articleComment.response"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf die Antwort {if $responseAuthor}von <strong>{$responseAuthor->username}</strong>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <strong>{$commentAuthor->username}</strong>{else}eines Gasts{/if} zum Artikel <strong>{$articleContent->getTitle()}</strong> reagiert.]]></item>
4231+
<item name="wcf.like.title.com.woltlab.wcf.pageComment"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf den Kommentar {if $commentAuthor}von <strong>{$commentAuthor->username}</strong>{else}eines Gasts{/if} zu der Seite <strong>{$page->getTitle()}</strong> reagiert.]]></item>
4232+
<item name="wcf.like.title.com.woltlab.wcf.pageComment.response"><![CDATA[<strong>{$author}</strong> hat mit {unsafe:$reaction->render()} auf die Antwort {if $responseAuthor}von <strong>{$responseAuthor->username}</strong>{else}eines Gasts{/if} zum Kommentar {if $commentAuthor}von <strong>{$commentAuthor->username}</strong>{else}eines Gasts{/if} zu der Seite <strong>{$page->getTitle()}</strong> reagiert.]]></item>
42334233
<item name="wcf.like.reaction.label"><![CDATA[{#$reactions} Reaktion{if $reactions != 1}en{/if}]]></item>
42344234
<item name="wcf.like.reaction.more"><![CDATA[Weitere Reaktionen]]></item>
42354235
<item name="wcf.like.reaction.noMoreEntries"><![CDATA[Keine weiteren Reaktionen]]></item>

wcfsetup/install/lang/en.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4172,10 +4172,10 @@ Allowed extensions: gif, jpg, jpeg, png, webp]]></item>
41724172
<item name="wcf.like.title.com.woltlab.wcf.user.profileComment"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on <strong>{$user->username}’s wall</strong>.]]></item>
41734173
<item name="wcf.like.title.com.woltlab.wcf.user.profileComment.response"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the response by {if $responseAuthor}<strong>{$responseAuthor->username}</strong>{else}a guest{/if} on the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on <strong>{$user->username}’s wall</strong>.]]></item>
41744174
<item name="wcf.like.objectType.com.woltlab.wcf.likeableArticle"><![CDATA[Article]]></item>
4175-
<item name="wcf.like.title.com.woltlab.wcf.articleComment"><![CDATA[Reacted with {@$reaction->render()} to the comment by {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}a guest{/if} on the article <a href="{$comment->getLink()}">{$articleContent->getTitle()}</a>.]]></item>
4176-
<item name="wcf.like.title.com.woltlab.wcf.articleComment.response"><![CDATA[Reacted with {@$reaction->render()} to the response by {if $responseAuthor}<a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a>{else}a guest{/if} on the comment by {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}a guest{/if} on the article <a href="{$response->getLink()}">{$articleContent->getTitle()}</a>.]]></item>
4177-
<item name="wcf.like.title.com.woltlab.wcf.pageComment"><![CDATA[Reacted with {@$reaction->render()} to the comment by {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}a guest{/if} on the page <a href="{$comment->getLink()}">{$page->getTitle()}</a>.]]></item>
4178-
<item name="wcf.like.title.com.woltlab.wcf.pageComment.response"><![CDATA[Reacted with {@$reaction->render()} to the response by {if $responseAuthor}<a href="{link controller='User' object=$responseAuthor}{/link}">{$responseAuthor->username}</a>{else}a guest{/if} on the comment by {if $commentAuthor}<a href="{link controller='User' object=$commentAuthor}{/link}">{$commentAuthor->username}</a>{else}a guest{/if} on the page <a href="{$response->getLink()}">{$page->getTitle()}</a>.]]></item>
4175+
<item name="wcf.like.title.com.woltlab.wcf.articleComment"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on the article <strong>{$articleContent->getTitle()}</strong>.]]></item>
4176+
<item name="wcf.like.title.com.woltlab.wcf.articleComment.response"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the response by {if $responseAuthor}<strong>{$responseAuthor->username}</strong>{else}a guest{/if} on the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on the article <strong>{$articleContent->getTitle()}</strong>.]]></item>
4177+
<item name="wcf.like.title.com.woltlab.wcf.pageComment"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on the page <strong>{$page->getTitle()}</strong>.]]></item>
4178+
<item name="wcf.like.title.com.woltlab.wcf.pageComment.response"><![CDATA[<strong>{$author}</strong> reacted with {unsafe:$reaction->render()} to the response by {if $responseAuthor}<strong>{$responseAuthor->username}</strong>{else}a guest{/if} on the comment by {if $commentAuthor}<strong>{$commentAuthor->username}</strong>{else}a guest{/if} on the page <strong>{$page->getTitle()}</strong>.]]></item>
41794179
<item name="wcf.like.reaction.label"><![CDATA[{#$reactions} reaction{if $reactions != 1}s{/if}]]></item>
41804180
<item name="wcf.like.reaction.more"><![CDATA[More Reactions]]></item>
41814181
<item name="wcf.like.reaction.noMoreEntries"><![CDATA[There are no new reactions at the moment.]]></item>

0 commit comments

Comments
 (0)