diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-01 16:50:52 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-07-01 16:50:52 +0300 |
commit | aa9ddf54683f4f967e7eef69b55a4ca2c258fa1a (patch) | |
tree | 3d60918a50e375eac9f7663316fc6e85af370599 /lib/Chat | |
parent | 86164d4838a7f2d0102b4bd68f18ceab0bb04a93 (diff) |
Circumvent the max message length when reading from database
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Chat')
-rw-r--r-- | lib/Chat/CommentsManager.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Chat/CommentsManager.php b/lib/Chat/CommentsManager.php index 214bdc266..eefdab713 100644 --- a/lib/Chat/CommentsManager.php +++ b/lib/Chat/CommentsManager.php @@ -52,7 +52,11 @@ class CommentsManager extends Manager { * @return IComment */ public function getCommentFromData(array $data): IComment { - return new Comment($this->normalizeDatabaseData($data)); + $message = $data['message']; + unset($data['message']); + $comment = new Comment($this->normalizeDatabaseData($data)); + $comment->setMessage($message, ChatManager::MAX_CHAT_LENGTH); + return $comment; } /** |