mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-09 11:22:00 +02:00
Validate room ids
This commit is contained in:
parent
eaaa837e00
commit
ec954f47fb
1 changed files with 5 additions and 1 deletions
|
@ -16,7 +16,7 @@
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
|
|
||||||
from synapse.api.errors import SynapseError
|
from synapse.api.errors import SynapseError
|
||||||
from synapse.types import UserID, get_domain_from_id
|
from synapse.types import UserID, get_domain_from_id, RoomID
|
||||||
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@ -160,6 +160,8 @@ class GroupsServerHandler(object):
|
||||||
"""
|
"""
|
||||||
yield self.check_group_is_ours(group_id, and_exists=True, and_is_admin=user_id)
|
yield self.check_group_is_ours(group_id, and_exists=True, and_is_admin=user_id)
|
||||||
|
|
||||||
|
RoomID.from_string(room_id) # Ensure valid room id
|
||||||
|
|
||||||
order = content.get("order", None)
|
order = content.get("order", None)
|
||||||
|
|
||||||
is_public = _parse_visibility_from_contents(content)
|
is_public = _parse_visibility_from_contents(content)
|
||||||
|
@ -463,6 +465,8 @@ class GroupsServerHandler(object):
|
||||||
def add_room_to_group(self, group_id, requester_user_id, room_id, content):
|
def add_room_to_group(self, group_id, requester_user_id, room_id, content):
|
||||||
"""Add room to group
|
"""Add room to group
|
||||||
"""
|
"""
|
||||||
|
RoomID.from_string(room_id) # Ensure valid room id
|
||||||
|
|
||||||
yield self.check_group_is_ours(
|
yield self.check_group_is_ours(
|
||||||
group_id, and_exists=True, and_is_admin=requester_user_id
|
group_id, and_exists=True, and_is_admin=requester_user_id
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue