From c7e2c01248426f7e59ecda14ac42e20ae2b70ee4 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Sun, 17 Jun 2018 11:33:57 +0100 Subject: [PATCH] fix the check for whether `is_url` to match all the other ones in codebase Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- synapse/api/filtering.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index 83206348e5..4937ad4a07 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -351,7 +351,12 @@ class Filter(object): room_id = event.get("room_id", None) ev_type = event.get("type", None) - is_url = "url" in event.get("content", {}) + + content = event.get("content", {}) + is_url = ( + "url" in content + and isinstance(content["url"], basestring) + ) return self.check_fields( room_id,