]> granicus.if.org Git - ejabberd/commitdiff
Fix error in mod_vcard when lowercasing some vjud search result fields (EJAB-1490)
authorBadlop <badlop@process-one.net>
Sat, 26 Nov 2011 16:08:10 +0000 (17:08 +0100)
committerBadlop <badlop@process-one.net>
Sat, 26 Nov 2011 16:08:17 +0000 (17:08 +0100)
src/mod_vcard.erl
src/mod_vcard_odbc.erl

index 77dc30b1551dbb42bd2fb7b632a5033107f09054..1820f64b88958c9230138040c18f1434f0e8135f 100644 (file)
@@ -219,17 +219,17 @@ set_vcard(User, LServer, VCARD) ->
            end,
 
     LUser     = jlib:nodeprep(User),
-    LFN       = stringprep:tolower(FN),
-    LFamily   = stringprep:tolower(Family),
-    LGiven    = stringprep:tolower(Given),
-    LMiddle   = stringprep:tolower(Middle),
-    LNickname = stringprep:tolower(Nickname),
-    LBDay     = stringprep:tolower(BDay),
-    LCTRY     = stringprep:tolower(CTRY),
-    LLocality = stringprep:tolower(Locality),
-    LEMail    = stringprep:tolower(EMail),
-    LOrgName  = stringprep:tolower(OrgName),
-    LOrgUnit  = stringprep:tolower(OrgUnit),
+    LFN       = string:to_lower(FN),
+    LFamily   = string:to_lower(Family),
+    LGiven    = string:to_lower(Given),
+    LMiddle   = string:to_lower(Middle),
+    LNickname = string:to_lower(Nickname),
+    LBDay     = string:to_lower(BDay),
+    LCTRY     = string:to_lower(CTRY),
+    LLocality = string:to_lower(Locality),
+    LEMail    = string:to_lower(EMail),
+    LOrgName  = string:to_lower(OrgName),
+    LOrgUnit  = string:to_lower(OrgUnit),
 
     US = {LUser, LServer},
 
@@ -541,7 +541,7 @@ filter_fields([], Match, _LServer) ->
     Match;
 filter_fields([{SVar, [Val]} | Ds], Match, LServer)
   when is_list(Val) and (Val /= "") ->
-    LVal = stringprep:tolower(Val),
+    LVal = string:to_lower(Val),
     NewMatch = case SVar of
                    "user" ->
                       case gen_mod:get_module_opt(LServer, ?MODULE,
@@ -618,17 +618,17 @@ set_vcard_t(R, _) ->
     OrgUnit  = xml:get_path_s(VCARD, [{elem, "ORG"}, {elem, "ORGUNIT"}, cdata]),
 
     {LUser, _LServer} = US,
-    LFN       = stringprep:tolower(FN),
-    LFamily   = stringprep:tolower(Family),
-    LGiven    = stringprep:tolower(Given),
-    LMiddle   = stringprep:tolower(Middle),
-    LNickname = stringprep:tolower(Nickname),
-    LBDay     = stringprep:tolower(BDay),
-    LCTRY     = stringprep:tolower(CTRY),
-    LLocality = stringprep:tolower(Locality),
-    LEMail    = stringprep:tolower(EMail),
-    LOrgName  = stringprep:tolower(OrgName),
-    LOrgUnit  = stringprep:tolower(OrgUnit),
+    LFN       = string:to_lower(FN),
+    LFamily   = string:to_lower(Family),
+    LGiven    = string:to_lower(Given),
+    LMiddle   = string:to_lower(Middle),
+    LNickname = string:to_lower(Nickname),
+    LBDay     = string:to_lower(BDay),
+    LCTRY     = string:to_lower(CTRY),
+    LLocality = string:to_lower(Locality),
+    LEMail    = string:to_lower(EMail),
+    LOrgName  = string:to_lower(OrgName),
+    LOrgUnit  = string:to_lower(OrgUnit),
 
     if
        (LUser     == error) or
index c35f2736290cee6841fd0a3c9d4e1a64a89454e9..a4c23624c310fa1134b501ff81504cd999357857 100644 (file)
@@ -186,17 +186,17 @@ set_vcard(User, LServer, VCARD) ->
            end,
 
     LUser     = jlib:nodeprep(User),
-    LFN       = stringprep:tolower(FN),
-    LFamily   = stringprep:tolower(Family),
-    LGiven    = stringprep:tolower(Given),
-    LMiddle   = stringprep:tolower(Middle),
-    LNickname = stringprep:tolower(Nickname),
-    LBDay     = stringprep:tolower(BDay),
-    LCTRY     = stringprep:tolower(CTRY),
-    LLocality = stringprep:tolower(Locality),
-    LEMail    = stringprep:tolower(EMail),
-    LOrgName  = stringprep:tolower(OrgName),
-    LOrgUnit  = stringprep:tolower(OrgUnit),
+    LFN       = string:to_lower(FN),
+    LFamily   = string:to_lower(Family),
+    LGiven    = string:to_lower(Given),
+    LMiddle   = string:to_lower(Middle),
+    LNickname = string:to_lower(Nickname),
+    LBDay     = string:to_lower(BDay),
+    LCTRY     = string:to_lower(CTRY),
+    LLocality = string:to_lower(Locality),
+    LEMail    = string:to_lower(EMail),
+    LOrgName  = string:to_lower(OrgName),
+    LOrgUnit  = string:to_lower(OrgUnit),
 
     if
        (LUser     == error) or
@@ -531,7 +531,7 @@ filter_fields([], Match, _LServer) ->
     end;
 filter_fields([{SVar, [Val]} | Ds], Match, LServer)
   when is_list(Val) and (Val /= "") ->
-    LVal = stringprep:tolower(Val),
+    LVal = string:to_lower(Val),
     NewMatch = case SVar of
                    "user"     -> make_val(Match, "lusername", LVal);
                    "fn"       -> make_val(Match, "lfn",       LVal);