diff options
author | Badlop <badlop@process-one.net> | 2011-04-11 19:58:25 +0200 |
---|---|---|
committer | Badlop <badlop@process-one.net> | 2011-04-11 19:59:26 +0200 |
commit | 7d7621c67c5b599c8a2b0b01f2719816db539d82 (patch) | |
tree | 8fc9d13f4b9ca4ef79e455ff23118701a05a124e /src | |
parent | Send jid attribute when occupant is banned (EJAB-1432) (diff) |
Support more captcha_host value formats (EJAB-1418)
Diffstat (limited to 'src')
-rw-r--r-- | src/ejabberd_captcha.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/ejabberd_captcha.erl b/src/ejabberd_captcha.erl index 797a6152..91e14c73 100644 --- a/src/ejabberd_captcha.erl +++ b/src/ejabberd_captcha.erl @@ -407,13 +407,17 @@ get_prog_name() -> get_url(Str) -> CaptchaHost = ejabberd_config:get_local_option(captcha_host), case string:tokens(CaptchaHost, ":") of - [TransferProt, Host, PortString] -> - TransferProt ++ ":" ++ Host ++ ":" ++ PortString ++ "/captcha/" ++ Str; + [Host] -> + "http://" ++ Host ++ "/captcha/" ++ Str; + ["http"++_ = TransferProt, Host] -> + TransferProt ++ ":" ++ Host ++ "/captcha/" ++ Str; [Host, PortString] -> TransferProt = atom_to_list(get_transfer_protocol(PortString)), TransferProt ++ "://" ++ Host ++ ":" ++ PortString ++ "/captcha/" ++ Str; + [TransferProt, Host, PortString] -> + TransferProt ++ ":" ++ Host ++ ":" ++ PortString ++ "/captcha/" ++ Str; _ -> - "http://" ++ ?MYNAME ++ ":5280/captcha/" ++ Str + "http://" ++ ?MYNAME ++ "/captcha/" ++ Str end. get_transfer_protocol(PortString) -> |