]> granicus.if.org Git - ejabberd/commitdiff
Match ldap_uidattr_format case-insensitively (EJAB-1449)
authorEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 23 Jun 2011 05:14:15 +0000 (15:14 +1000)
committerEvgeniy Khramtsov <ekhramtsov@process-one.net>
Thu, 23 Jun 2011 05:14:15 +0000 (15:14 +1000)
src/eldap/eldap_utils.erl

index 5f3a24283a78f6f74f412c4302781b3362edf2fa..66a1fcfefea5b4dea09a4275b64055f964685390 100644 (file)
@@ -95,7 +95,14 @@ get_user_part(String, Pattern) ->
            {error, badmatch};
        Result ->
            case regexp:sub(Pattern, "%u", Result) of
-               {ok, String, _} -> {ok, Result};
+               {ok, StringRes, _} ->
+                    case (string:to_lower(StringRes) ==
+                              string:to_lower(String)) of
+                        true ->
+                            {ok, Result};
+                        false ->
+                            {error, badmatch}
+                    end;
                _ -> {error, badmatch}
            end
     end.