diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index 3b5e5686e..906d3968c 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -310,12 +310,8 @@ create_captcha_x(SID, To, Lang, HeadEls, TailEls) -> ] ++ TailEls }, Tref = erlang:send_after(?CAPTCHA_LIFETIME, ?MODULE, {remove_id, Id}), - case ets:insert(captcha, #captcha{id=Id, key=Key, tref=Tref}) of - true -> - {ok, [Captcha, Data]}; - _Err -> - error - end; + ets:insert(captcha, #captcha{id=Id, key=Key, tref=Tref}), + {ok, [Captcha, Data]}; _ -> error end. diff --git a/src/mod_register.erl b/src/mod_register.erl index bfc55ad44..cde22b365 100644 --- a/src/mod_register.erl +++ b/src/mod_register.erl @@ -505,9 +505,7 @@ write_time({{Y,Mo,D},{H,Mi,S}}) -> process_xdata_submit(El) -> case exmpp_xml:get_element(El, x) of - false -> - error; - Xdata -> + #xmlel{} = Xdata -> Fields = jlib:parse_xdata_submit(Xdata), case catch {proplists:get_value("username", Fields), proplists:get_value("password", Fields)} of @@ -515,7 +513,9 @@ process_xdata_submit(El) -> {ok, User, Pass}; _ -> error - end + end; + _ -> + error end. is_strong_password(Server, Password) ->