From 90a72ea9fd231856df592332bb00e7490a12e446 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 10 Sep 2013 18:34:38 +0200 Subject: [PATCH] Use the regexp frontend module (EJAB-921) --- mod_logsession/src/mod_logsession.erl | 2 +- mod_openid/src/mod_openid.erl | 2 +- mod_webpresence/src/mod_webpresence.erl | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/mod_logsession/src/mod_logsession.erl b/mod_logsession/src/mod_logsession.erl index a67931a..97a9062 100644 --- a/mod_logsession/src/mod_logsession.erl +++ b/mod_logsession/src/mod_logsession.erl @@ -115,7 +115,7 @@ get_process_name(Host) -> gen_mod:get_module_proc(Host, ?PROCNAME). replace_host(Host, Filename) -> - element(2, regexp:gsub(Filename, "@HOST@", Host)). + re:replace(Filename, "@HOST@", Host, [global, {return, list}]). open_file(Filename) -> {ok, File} = file:open(Filename, [append]), diff --git a/mod_openid/src/mod_openid.erl b/mod_openid/src/mod_openid.erl index 5cb7cd9..3e2c5be 100644 --- a/mod_openid/src/mod_openid.erl +++ b/mod_openid/src/mod_openid.erl @@ -133,7 +133,7 @@ check_authentication2(AssocHandle, Sig, Signed, Query) -> %% Fields is a list of fields which should be in the query as openid.Field %% return the list of argument [{Key,Value}] as they appears in the query retrieve_params(Fields,Query) -> - {ok, FList} = regexp:split(Fields, ","), + FList = re:split(Fields, ",", [{return, list}]), retrieve_params_recurse(FList,Query). retrieve_params_recurse([],_) -> []; retrieve_params_recurse([Key | Tail ], Query) -> diff --git a/mod_webpresence/src/mod_webpresence.erl b/mod_webpresence/src/mod_webpresence.erl index 327292b..53d3454 100644 --- a/mod_webpresence/src/mod_webpresence.erl +++ b/mod_webpresence/src/mod_webpresence.erl @@ -667,9 +667,8 @@ intund2string(undefined) -> "undefined"; intund2string(Int) when is_integer(Int) -> integer_to_list(Int). escape(S1) -> - {ok, S2, _} = regexp:gsub(S1, "\'", "\\'"), - {ok, S3, _} = regexp:gsub(S2, "\n", "\\n"), - S3. + S2 = re:replace(S1, "\'", "\\'", [global, {return, list}]), + re:replace(S2, "\n", "\\n", [global, {return, list}]). get_baseurl(Host) -> Proc = gen_mod:get_module_proc(Host, ?PROCNAME),