0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-12-14 12:43:50 +01:00

Merge pull request #308 from matrix-org/markjh/v2_filter_encoding

Encode the filter JSON as UTF-8 before storing in the database.
This commit is contained in:
Mark Haines 2015-10-16 13:41:31 +01:00
commit 5df54de801

View file

@ -34,10 +34,10 @@ class FilteringStore(SQLBaseStore):
desc="get_user_filter",
)
defer.returnValue(json.loads(def_json))
defer.returnValue(json.loads(def_json.decode("utf-8")))
def add_user_filter(self, user_localpart, user_filter):
def_json = json.dumps(user_filter)
def_json = json.dumps(user_filter).encode("utf-8")
# Need an atomic transaction to SELECT the maximal ID so far then
# INSERT a new one