summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--model/post.go4
-rw-r--r--store/sql_post_store.go2
2 files changed, 5 insertions, 1 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
}
diff --git a/store/sql_post_store.go b/store/sql_post_store.go
index 1831eb23c..9db5806c5 100644
--- a/store/sql_post_store.go
+++ b/store/sql_post_store.go
@@ -30,7 +30,7 @@ func NewSqlPostStore(sqlStore *SqlStore) PostStore {
table.ColMap("Message").SetMaxSize(4000)
table.ColMap("Type").SetMaxSize(26)
table.ColMap("Hashtags").SetMaxSize(1000)
- table.ColMap("Props")
+ table.ColMap("Props").SetMaxSize(8000)
table.ColMap("Filenames").SetMaxSize(4000)
}