]> granicus.if.org Git - ejabberd/commitdiff
Handle multiple < and > in mod_muc_log plaintext mode (EJAB-1640)
authorBadlop <badlop@process-one.net>
Fri, 31 May 2013 11:23:08 +0000 (13:23 +0200)
committerBadlop <badlop@process-one.net>
Fri, 31 May 2013 11:23:08 +0000 (13:23 +0200)
src/mod_muc/mod_muc_log.erl

index 95b25d6a7e2c6aa097015d7f0dbf5e66d864b4c2..ec62c85fdd910969f43762297d258576a7322a25 100644 (file)
@@ -977,9 +977,9 @@ htmlize(S1, FileFormat) ->
 %% The NoFollow parameter tell if the spam prevention should be applied to the link found
 %% true means 'apply nofollow on links'.
 htmlize(S0, _NoFollow, plaintext) ->
-    S1 = ejabberd_regexp:greplace(S0, <<"~">>, ?PLAINTEXT_CO),
-    S1x = ejabberd_regexp:replace(S1, <<"<">>, ?PLAINTEXT_IN),
-    ejabberd_regexp:replace(S1x, <<">">>, ?PLAINTEXT_OUT);
+    S1  = ejabberd_regexp:greplace(S0, <<"~">>, ?PLAINTEXT_CO),
+    S1x = ejabberd_regexp:greplace(S1, <<"<">>, ?PLAINTEXT_IN),
+    ejabberd_regexp:greplace(S1x, <<">">>, ?PLAINTEXT_OUT);
 htmlize(S1, NoFollow, _FileFormat) ->
     S2_list = str:tokens(S1, <<"\n">>),
     lists:foldl(fun (Si, Res) ->