25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-26 17:38:45 +01:00

Fix error in mod_vcard when lowercasing some vjud search result fields (EJAB-1490)

This commit is contained in:
Badlop 2011-11-26 17:08:10 +01:00
parent 1f97740cfa
commit ee968b5573
2 changed files with 35 additions and 35 deletions

View File

@ -219,17 +219,17 @@ set_vcard(User, LServer, VCARD) ->
end, end,
LUser = jlib:nodeprep(User), LUser = jlib:nodeprep(User),
LFN = stringprep:tolower(FN), LFN = string:to_lower(FN),
LFamily = stringprep:tolower(Family), LFamily = string:to_lower(Family),
LGiven = stringprep:tolower(Given), LGiven = string:to_lower(Given),
LMiddle = stringprep:tolower(Middle), LMiddle = string:to_lower(Middle),
LNickname = stringprep:tolower(Nickname), LNickname = string:to_lower(Nickname),
LBDay = stringprep:tolower(BDay), LBDay = string:to_lower(BDay),
LCTRY = stringprep:tolower(CTRY), LCTRY = string:to_lower(CTRY),
LLocality = stringprep:tolower(Locality), LLocality = string:to_lower(Locality),
LEMail = stringprep:tolower(EMail), LEMail = string:to_lower(EMail),
LOrgName = stringprep:tolower(OrgName), LOrgName = string:to_lower(OrgName),
LOrgUnit = stringprep:tolower(OrgUnit), LOrgUnit = string:to_lower(OrgUnit),
US = {LUser, LServer}, US = {LUser, LServer},
@ -541,7 +541,7 @@ filter_fields([], Match, _LServer) ->
Match; Match;
filter_fields([{SVar, [Val]} | Ds], Match, LServer) filter_fields([{SVar, [Val]} | Ds], Match, LServer)
when is_list(Val) and (Val /= "") -> when is_list(Val) and (Val /= "") ->
LVal = stringprep:tolower(Val), LVal = string:to_lower(Val),
NewMatch = case SVar of NewMatch = case SVar of
"user" -> "user" ->
case gen_mod:get_module_opt(LServer, ?MODULE, 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]), OrgUnit = xml:get_path_s(VCARD, [{elem, "ORG"}, {elem, "ORGUNIT"}, cdata]),
{LUser, _LServer} = US, {LUser, _LServer} = US,
LFN = stringprep:tolower(FN), LFN = string:to_lower(FN),
LFamily = stringprep:tolower(Family), LFamily = string:to_lower(Family),
LGiven = stringprep:tolower(Given), LGiven = string:to_lower(Given),
LMiddle = stringprep:tolower(Middle), LMiddle = string:to_lower(Middle),
LNickname = stringprep:tolower(Nickname), LNickname = string:to_lower(Nickname),
LBDay = stringprep:tolower(BDay), LBDay = string:to_lower(BDay),
LCTRY = stringprep:tolower(CTRY), LCTRY = string:to_lower(CTRY),
LLocality = stringprep:tolower(Locality), LLocality = string:to_lower(Locality),
LEMail = stringprep:tolower(EMail), LEMail = string:to_lower(EMail),
LOrgName = stringprep:tolower(OrgName), LOrgName = string:to_lower(OrgName),
LOrgUnit = stringprep:tolower(OrgUnit), LOrgUnit = string:to_lower(OrgUnit),
if if
(LUser == error) or (LUser == error) or

View File

@ -186,17 +186,17 @@ set_vcard(User, LServer, VCARD) ->
end, end,
LUser = jlib:nodeprep(User), LUser = jlib:nodeprep(User),
LFN = stringprep:tolower(FN), LFN = string:to_lower(FN),
LFamily = stringprep:tolower(Family), LFamily = string:to_lower(Family),
LGiven = stringprep:tolower(Given), LGiven = string:to_lower(Given),
LMiddle = stringprep:tolower(Middle), LMiddle = string:to_lower(Middle),
LNickname = stringprep:tolower(Nickname), LNickname = string:to_lower(Nickname),
LBDay = stringprep:tolower(BDay), LBDay = string:to_lower(BDay),
LCTRY = stringprep:tolower(CTRY), LCTRY = string:to_lower(CTRY),
LLocality = stringprep:tolower(Locality), LLocality = string:to_lower(Locality),
LEMail = stringprep:tolower(EMail), LEMail = string:to_lower(EMail),
LOrgName = stringprep:tolower(OrgName), LOrgName = string:to_lower(OrgName),
LOrgUnit = stringprep:tolower(OrgUnit), LOrgUnit = string:to_lower(OrgUnit),
if if
(LUser == error) or (LUser == error) or
@ -531,7 +531,7 @@ filter_fields([], Match, _LServer) ->
end; end;
filter_fields([{SVar, [Val]} | Ds], Match, LServer) filter_fields([{SVar, [Val]} | Ds], Match, LServer)
when is_list(Val) and (Val /= "") -> when is_list(Val) and (Val /= "") ->
LVal = stringprep:tolower(Val), LVal = string:to_lower(Val),
NewMatch = case SVar of NewMatch = case SVar of
"user" -> make_val(Match, "lusername", LVal); "user" -> make_val(Match, "lusername", LVal);
"fn" -> make_val(Match, "lfn", LVal); "fn" -> make_val(Match, "lfn", LVal);