From 0ab153d2014d871c13b02dbd1c6bf7c0cc0bcedc Mon Sep 17 00:00:00 2001
From: Erik Johnston <erik@matrix.org>
Date: Thu, 20 Jul 2017 16:24:18 +0100
Subject: [PATCH] Check values are strings

---
 synapse/groups/groups_server.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/synapse/groups/groups_server.py b/synapse/groups/groups_server.py
index 322aad2a6f..b1ee43ef90 100644
--- a/synapse/groups/groups_server.py
+++ b/synapse/groups/groups_server.py
@@ -353,7 +353,10 @@ class GroupsServerHandler(object):
         for keyname in ("name", "avatar_url", "short_description",
                         "long_description"):
             if keyname in content:
-                profile[keyname] = content[keyname]
+                value = content[keyname]
+                if not isinstance(value, basestring):
+                    raise SynapseError(400, "%r value is not a string" % (keyname,))
+                profile[keyname] = value
 
         yield self.store.update_group_profile(group_id, profile)
 
-- 
GitLab