Skip to content

Commit fb64c69

Browse files
authored
Apply suggestions from @nicolas-grekas
1 parent 2a59314 commit fb64c69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/Notifier/Bridge/Discord/DiscordTransport.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ final class DiscordTransport extends AbstractTransport
2929
{
3030
protected const HOST = 'discord.com';
3131

32-
private const MAX_SUBJECT_LENGTH = 2000;
32+
private const SUBJECT_LIMIT = 2000;
3333

3434
private $token;
3535
private $webhookId;
@@ -67,7 +67,7 @@ protected function doSend(MessageInterface $message): SentMessage
6767

6868
$content = $message->getSubject();
6969

70-
if (mb_strlen($content) > self::MAX_SUBJECT_LENGTH) {
70+
if (mb_strlen($content, 'UTF-8') > self::SUBJECT_LIMIT) {
7171
throw new LogicException('The subject length of a Discord message must not exceed 2000 characters.');
7272
}
7373

0 commit comments

Comments
 (0)