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

Match ldap_uidattr_format case-insensitively (EJAB-1449)

This commit is contained in:
Evgeniy Khramtsov 2011-06-23 15:14:15 +10:00
parent 06e3503976
commit 8d4945aa7f

View File

@ -94,9 +94,13 @@ get_user_part(String, Pattern) ->
{'EXIT', _} ->
{error, badmatch};
Result ->
case re:replace(Pattern, "%u", Result, [{return, list}]) of
String -> {ok, Result};
_ -> {error, badmatch}
case string:to_lower(
re:replace(Pattern, "%u", Result, [{return, list}])) ==
string:to_lower(String) of
true ->
{ok, Result};
false ->
{error, badmatch}
end
end.