Check if instances are lists, not sequences. (#12128)

As a str is a sequence, the checks were not granular
enough and would allow lists or strings, when only
lists were valid.
This commit is contained in:
Patrick Cloke 2022-03-02 08:18:51 -05:00 committed by GitHub
parent f3f0ab10fe
commit 1103c5fe8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View file

@ -857,7 +857,7 @@ class _RoomEntry:
def _has_valid_via(e: EventBase) -> bool:
via = e.content.get("via")
if not via or not isinstance(via, Sequence):
if not via or not isinstance(via, list):
return False
for v in via:
if not isinstance(v, str):