Use the regexp frontend module (EJAB-921)
This commit is contained in:
parent
9dcb9b2364
commit
90a72ea9fd
|
@ -115,7 +115,7 @@ get_process_name(Host) ->
|
||||||
gen_mod:get_module_proc(Host, ?PROCNAME).
|
gen_mod:get_module_proc(Host, ?PROCNAME).
|
||||||
|
|
||||||
replace_host(Host, Filename) ->
|
replace_host(Host, Filename) ->
|
||||||
element(2, regexp:gsub(Filename, "@HOST@", Host)).
|
re:replace(Filename, "@HOST@", Host, [global, {return, list}]).
|
||||||
|
|
||||||
open_file(Filename) ->
|
open_file(Filename) ->
|
||||||
{ok, File} = file:open(Filename, [append]),
|
{ok, File} = file:open(Filename, [append]),
|
||||||
|
|
|
@ -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
|
%% 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
|
%% return the list of argument [{Key,Value}] as they appears in the query
|
||||||
retrieve_params(Fields,Query) ->
|
retrieve_params(Fields,Query) ->
|
||||||
{ok, FList} = regexp:split(Fields, ","),
|
FList = re:split(Fields, ",", [{return, list}]),
|
||||||
retrieve_params_recurse(FList,Query).
|
retrieve_params_recurse(FList,Query).
|
||||||
retrieve_params_recurse([],_) -> [];
|
retrieve_params_recurse([],_) -> [];
|
||||||
retrieve_params_recurse([Key | Tail ], Query) ->
|
retrieve_params_recurse([Key | Tail ], Query) ->
|
||||||
|
|
|
@ -667,9 +667,8 @@ intund2string(undefined) -> "undefined";
|
||||||
intund2string(Int) when is_integer(Int) -> integer_to_list(Int).
|
intund2string(Int) when is_integer(Int) -> integer_to_list(Int).
|
||||||
|
|
||||||
escape(S1) ->
|
escape(S1) ->
|
||||||
{ok, S2, _} = regexp:gsub(S1, "\'", "\\'"),
|
S2 = re:replace(S1, "\'", "\\'", [global, {return, list}]),
|
||||||
{ok, S3, _} = regexp:gsub(S2, "\n", "\\n"),
|
re:replace(S2, "\n", "\\n", [global, {return, list}]).
|
||||||
S3.
|
|
||||||
|
|
||||||
get_baseurl(Host) ->
|
get_baseurl(Host) ->
|
||||||
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
Proc = gen_mod:get_module_proc(Host, ?PROCNAME),
|
||||||
|
|
Loading…
Reference in New Issue