From: Badlop Date: Thu, 30 May 2013 12:08:18 +0000 (+0200) Subject: Handle ~ control sequence in text of mod_muc_log (EJAB-1639) X-Git-Tag: v2.1.13~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bc8264b2ac6cf58d267dc06bb0d45585d5d677d0;p=ejabberd Handle ~ control sequence in text of mod_muc_log (EJAB-1639) --- diff --git a/src/mod_muc/mod_muc_log.erl b/src/mod_muc/mod_muc_log.erl index 27f1340dc..7f45bd416 100644 --- a/src/mod_muc/mod_muc_log.erl +++ b/src/mod_muc/mod_muc_log.erl @@ -455,7 +455,7 @@ add_message_to_log(Nick1, Message, RoomJID, Opts, State) -> STimeUnique = io_lib:format("~s.~w", [STime, Microsecs]), %% Write message - fw(F, io_lib:format("[~s] ", + catch fw(F, io_lib:format("[~s] ", [STimeUnique, STimeUnique, STimeUnique, STime]) ++ Text, FileFormat), %% Close file @@ -787,13 +787,14 @@ htmlize(S1) -> htmlize(S1, html). htmlize(S1, plaintext) -> - S1; + ejabberd_regexp:replace(S1, "~", "~~"); htmlize(S1, FileFormat) -> htmlize(S1, false, FileFormat). %% The NoFollow parameter tell if the spam prevention should be applied to the link found %% true means 'apply nofollow on links'. -htmlize(S1, _NoFollow, plaintext) -> +htmlize(S0, _NoFollow, plaintext) -> + S1 = ejabberd_regexp:replace(S0, "~", "~~"), S1x = ejabberd_regexp:replace(S1, "<", ?PLAINTEXT_IN), ejabberd_regexp:replace(S1x, ">", ?PLAINTEXT_OUT); htmlize(S1, NoFollow, _FileFormat) ->