Skip to content

Commit aa9ddf5

Browse files
committed
Circumvent the max message length when reading from database
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 86164d4 commit aa9ddf5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/Chat/CommentsManager.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ public function __construct(
5252
* @return IComment
5353
*/
5454
public function getCommentFromData(array $data): IComment {
55-
return new Comment($this->normalizeDatabaseData($data));
55+
$message = $data['message'];
56+
unset($data['message']);
57+
$comment = new Comment($this->normalizeDatabaseData($data));
58+
$comment->setMessage($message, ChatManager::MAX_CHAT_LENGTH);
59+
return $comment;
5660
}
5761

5862
/**

0 commit comments

Comments
 (0)