Skip to content

Commit 380526d

Browse files
Limit the size of recipient labels
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
1 parent a53dd10 commit 380526d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Db/MessageMapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
use function array_combine;
3737
use function array_keys;
3838
use function array_map;
39+
use function mb_substr;
3940

4041
class MessageMapper extends QBMapper {
4142

@@ -146,7 +147,7 @@ public function insertBulk(Message ...$messages): void {
146147

147148
$qb2->setParameter('message_id', $messageId, IQueryBuilder::PARAM_INT);
148149
$qb2->setParameter('type', $type, IQueryBuilder::PARAM_INT);
149-
$qb2->setParameter('label', $recipient->getLabel(), IQueryBuilder::PARAM_STR);
150+
$qb2->setParameter('label', mb_substr($recipient->getLabel(), 0, 255), IQueryBuilder::PARAM_STR);
150151
$qb2->setParameter('email', $recipient->getEmail(), IQueryBuilder::PARAM_STR);
151152

152153
$qb2->execute();

0 commit comments

Comments
 (0)