From 3faa47df4573256f7a6e3b4b7239c85a486e9bca Mon Sep 17 00:00:00 2001 From: Tom Quackenbush Date: Fri, 30 Sep 2016 16:55:33 +0000 Subject: [PATCH] move list_to_bin on filterMessageText for clarity --- .DS_Store | Bin 6148 -> 0 bytes mod_pottymouth/src/mod_pottymouth.erl | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 04767b967bcfeca655a83489f10aee9f1f045125..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ8r^25S>XVkRl;U%DnfQ6L;Oex%6>*G0ZZ+1CTcoguqPC+`D( zlQSyqcir*pv$caI(x?CxpaN8Y3Q&Q&708x4eY?973s3A2dY0#x9s6wt|fyI$dyvbT<2&U$Tuf50v04{nCNQ?PhD k26{Wj!P@b{lOnI!9`|cvALw+%oet#BfayY`0*_YU9}2k_q5uE@ diff --git a/mod_pottymouth/src/mod_pottymouth.erl b/mod_pottymouth/src/mod_pottymouth.erl index 8fa3e59..0e8bc6f 100644 --- a/mod_pottymouth/src/mod_pottymouth.erl +++ b/mod_pottymouth/src/mod_pottymouth.erl @@ -49,11 +49,11 @@ filterMessageText(MessageAttrs, MessageText) -> MessageWords = string:tokens(unicode:characters_to_list(MessageText, utf8), " "), MessageTerms = [{Lang, Word} || Word <- MessageWords], % we get back bytewise format terms (rather than utf8) - list_to_binary(string:join(filterWords(MessageTerms), " ")). + string:join(filterWords(MessageTerms), " "). filterMessageBodyElements([{xmlel, <<"body">>, BodyAttr, [{xmlcdata, MessageText}]} = _H|T], MessageElements) -> - FilteredMessageWords = filterMessageText(BodyAttr, binary:bin_to_list(MessageText)), + FilteredMessageWords = binary:list_to_bin(filterMessageText(BodyAttr, binary:bin_to_list(MessageText))), FilteredBody = {xmlel, <<"body">>, BodyAttr, [{xmlcdata, FilteredMessageWords}]}, filterMessageBodyElements(T, lists:append(MessageElements, [FilteredBody]));