mirror of
https://github.com/processone/ejabberd.git
synced 2024-06-14 22:00:16 +02:00
Replace regexp with ejabberd_regexp
This commit is contained in:
parent
298a4a3acf
commit
707bb0a321
|
@ -94,16 +94,17 @@ get_user_part(String, Pattern) ->
|
||||||
{'EXIT', _} ->
|
{'EXIT', _} ->
|
||||||
{error, badmatch};
|
{error, badmatch};
|
||||||
Result ->
|
Result ->
|
||||||
case regexp:sub(Pattern, "%u", Result) of
|
case catch ejabberd_regexp:replace(Pattern, "%u", Result) of
|
||||||
{ok, StringRes, _} ->
|
{'EXIT', _} ->
|
||||||
|
{error, badmatch};
|
||||||
|
StringRes ->
|
||||||
case (string:to_lower(StringRes) ==
|
case (string:to_lower(StringRes) ==
|
||||||
string:to_lower(String)) of
|
string:to_lower(String)) of
|
||||||
true ->
|
true ->
|
||||||
{ok, Result};
|
{ok, Result};
|
||||||
false ->
|
false ->
|
||||||
{error, badmatch}
|
{error, badmatch}
|
||||||
end;
|
end
|
||||||
_ -> {error, badmatch}
|
|
||||||
end
|
end
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user