summaryrefslogtreecommitdiff
path: root/src/pubsub_subscription.erl
diff options
context:
space:
mode:
authorPaweł Chmielowski <pchmielowski@process-one.net>2020-01-22 12:52:30 +0100
committerPaweł Chmielowski <pchmielowski@process-one.net>2020-01-22 12:55:27 +0100
commit75094df25eb739931237c7c2642334b270120443 (patch)
treec7775c07655b51b4e29f2f5b66a30e3570f29389 /src/pubsub_subscription.erl
parentFix 20.01 changelog (diff)
Do not use ~ts format in string that are put in xmpp payload
We are expecting utf8 data here, and using that flag will convert those to unicode codepoints, which aren't handled properly later.
Diffstat (limited to 'src/pubsub_subscription.erl')
-rw-r--r--src/pubsub_subscription.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pubsub_subscription.erl b/src/pubsub_subscription.erl
index ac5137d2..32a79aef 100644
--- a/src/pubsub_subscription.erl
+++ b/src/pubsub_subscription.erl
@@ -206,13 +206,13 @@ val_xfield(digest_frequency = Opt, [Val]) ->
case catch binary_to_integer(Val) of
N when is_integer(N) -> N;
_ ->
- Txt = {?T("Value of '~ts' should be integer"), [Opt]},
+ Txt = {?T("Value of '~s' should be integer"), [Opt]},
{error, xmpp:err_not_acceptable(Txt, ejabberd_option:language())}
end;
val_xfield(expire = Opt, [Val]) ->
try xmpp_util:decode_timestamp(Val)
catch _:{bad_timestamp, _} ->
- Txt = {?T("Value of '~ts' should be datetime string"), [Opt]},
+ Txt = {?T("Value of '~s' should be datetime string"), [Opt]},
{error, xmpp:err_not_acceptable(Txt, ejabberd_option:language())}
end;
val_xfield(include_body = Opt, [Val]) -> xopt_to_bool(Opt, Val);
@@ -224,7 +224,7 @@ val_xfield(subscription_depth = Opt, [Depth]) ->
case catch binary_to_integer(Depth) of
N when is_integer(N) -> N;
_ ->
- Txt = {?T("Value of '~ts' should be integer"), [Opt]},
+ Txt = {?T("Value of '~s' should be integer"), [Opt]},
{error, xmpp:err_not_acceptable(Txt, ejabberd_option:language())}
end.
@@ -234,7 +234,7 @@ xopt_to_bool(_, <<"1">>) -> true;
xopt_to_bool(_, <<"false">>) -> false;
xopt_to_bool(_, <<"true">>) -> true;
xopt_to_bool(Option, _) ->
- Txt = {?T("Value of '~ts' should be boolean"), [Option]},
+ Txt = {?T("Value of '~s' should be boolean"), [Option]},
{error, xmpp:err_not_acceptable(Txt, ejabberd_option:language())}.
%% Return a field for an XForm for Key, with data filled in, if