summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-12-03 11:57:20 -0500
committerJoramWilander <jwawilander@gmail.com>2015-12-03 11:57:20 -0500
commitcc111205f9c6cb152ca87f68c0a2f7aa519fdf59 (patch)
tree40e269234064d120e818ac48a2a3045bafb0c151 /model
parent61f90860a875cbf019570dfbb06ba716a7994fc3 (diff)
downloadchat-cc111205f9c6cb152ca87f68c0a2f7aa519fdf59.tar.gz
chat-cc111205f9c6cb152ca87f68c0a2f7aa519fdf59.tar.bz2
chat-cc111205f9c6cb152ca87f68c0a2f7aa519fdf59.zip
Add limit to Props size in Post table
Diffstat (limited to 'model')
-rw-r--r--model/post.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/model/post.go b/model/post.go
index 5578514b5..e66009dd6 100644
--- a/model/post.go
+++ b/model/post.go
@@ -112,6 +112,10 @@ func (o *Post) IsValid() *AppError {
return NewAppError("Post.IsValid", "Invalid filenames", "id="+o.Id)
}
+ if utf8.RuneCountInString(StringInterfaceToJson(o.Props)) > 8000 {
+ return NewAppError("Post.IsValid", "Invalid props", "id="+o.Id)
+ }
+
return nil
}