From 380526dc8e6fa936fd09b08a72ac9d76dc946a85 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 20 Apr 2020 16:39:24 +0200 Subject: [PATCH] Limit the size of recipient labels Signed-off-by: Christoph Wurst --- lib/Db/MessageMapper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Db/MessageMapper.php b/lib/Db/MessageMapper.php index 901cd462a6..1e0bde2adf 100644 --- a/lib/Db/MessageMapper.php +++ b/lib/Db/MessageMapper.php @@ -36,6 +36,7 @@ use function array_combine; use function array_keys; use function array_map; +use function mb_substr; class MessageMapper extends QBMapper { @@ -146,7 +147,7 @@ public function insertBulk(Message ...$messages): void { $qb2->setParameter('message_id', $messageId, IQueryBuilder::PARAM_INT); $qb2->setParameter('type', $type, IQueryBuilder::PARAM_INT); - $qb2->setParameter('label', $recipient->getLabel(), IQueryBuilder::PARAM_STR); + $qb2->setParameter('label', mb_substr($recipient->getLabel(), 0, 255), IQueryBuilder::PARAM_STR); $qb2->setParameter('email', $recipient->getEmail(), IQueryBuilder::PARAM_STR); $qb2->execute();