From: Badlop Date: Fri, 4 Nov 2016 16:28:28 +0000 (+0100) Subject: Throw error if room name or host has invalid characters (#1360) X-Git-Tag: 16.12~25^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49d3b7ec1de954cae7fb87cfd74267dfb9dcdf51;p=ejabberd Throw error if room name or host has invalid characters (#1360) --- diff --git a/src/mod_muc_admin.erl b/src/mod_muc_admin.erl index c9da1c66c..bd1c55f66 100644 --- a/src/mod_muc_admin.erl +++ b/src/mod_muc_admin.erl @@ -432,8 +432,8 @@ create_room(Name1, Host1, ServerHost) -> create_room_with_opts(Name1, Host1, ServerHost, []). create_room_with_opts(Name1, Host1, ServerHost, CustomRoomOpts) -> - Name = jid:nodeprep(Name1), - Host = jid:nodeprep(Host1), + true = (error /= (Name = jid:nodeprep(Name1))), + true = (error /= (Host = jid:nodeprep(Host1))), %% Get the default room options from the muc configuration DefRoomOpts = gen_mod:get_module_opt(ServerHost, mod_muc,