25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Apply URL decoding wherever possible

Fixes #1936
This commit is contained in:
Evgeniy Khramtsov 2017-08-13 19:18:19 +03:00
parent fd7bf7fed3
commit 63aabed320

View File

@ -80,7 +80,8 @@ convert_dir(Path, Host, Type) ->
case eval_file(FilePath) of case eval_file(FilePath) of
{ok, Data} -> {ok, Data} ->
Name = iolist_to_binary(filename:rootname(File)), Name = iolist_to_binary(filename:rootname(File)),
convert_data(Host, Type, Name, Data); convert_data(url_decode(Host), Type,
url_decode(Name), Data);
Err -> Err ->
Err Err
end end
@ -223,12 +224,10 @@ convert_data(Host, "privacy", User, [Data]) ->
end end
end, Lists)}, end, Lists)},
mod_privacy:set_list(Priv); mod_privacy:set_list(Priv);
convert_data(PubSub, "pubsub", NodeId, [Data]) -> convert_data(HostStr, "pubsub", Node, [Data]) ->
HostStr = url_decode(PubSub),
case decode_pubsub_host(HostStr) of case decode_pubsub_host(HostStr) of
Host when is_binary(Host); Host when is_binary(Host);
is_tuple(Host) -> is_tuple(Host) ->
Node = url_decode(NodeId),
Type = node_type(Host), Type = node_type(Host),
NodeData = convert_node_config(HostStr, Data), NodeData = convert_node_config(HostStr, Data),
DefaultConfig = mod_pubsub:config(Host, default_node_config, []), DefaultConfig = mod_pubsub:config(Host, default_node_config, []),