Skip to content

Commit e6d35b8

Browse files
committed
Fix problem introduced in recent commit (processone/ejabberd#4444)
1 parent cd20684 commit e6d35b8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/yconf.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,10 @@ to_atom(B) when is_binary(B) ->
991991
try binary_to_atom(B, latin1)
992992
catch _:system_limit -> fail({bad_length, 255})
993993
end;
994+
to_atom(L) when is_list(L) ->
995+
try list_to_atom(L)
996+
catch _:system_limit -> fail({bad_length, 255})
997+
end;
994998
to_atom(A) when is_atom(A) ->
995999
A;
9961000
to_atom(Bad) ->
@@ -1188,7 +1192,7 @@ parse_uri(URL) ->
11881192
parse_uri(URL, Protocols) when is_binary(URL) ->
11891193
parse_uri(binary_to_list(URL), Protocols);
11901194
parse_uri(URL0, Protocols) ->
1191-
URL = re:replace(URL0, <<"@[A-Z]+@">>, <<"MACRO">>, [{return, binary}]),
1195+
URL = re:replace(URL0, <<"@[A-Z]+@">>, <<"MACRO">>, [{return, list}]),
11921196
case uri_string:parse(URL) of
11931197
#{scheme := Scheme, host := Host, port := Port, path := Path} = M1 ->
11941198
{ok, Scheme, maps:get(userinfo, M1, ""), Host, Port, Path, maps:get(query, M1, "")};

0 commit comments

Comments
 (0)