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
1 changed files with 7 additions and 3 deletions

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.