From e1056516a5338827e8113914719b5e0aa7e15e5f Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 4 Mar 2010 19:36:49 +0000 Subject: [PATCH] Fix double &escaping; in the text body generated for incoming HTML. --- perl/lib/Thrasher/Component.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl/lib/Thrasher/Component.pm b/perl/lib/Thrasher/Component.pm index d33edbd..3ca9796 100644 --- a/perl/lib/Thrasher/Component.pm +++ b/perl/lib/Thrasher/Component.pm @@ -1442,12 +1442,17 @@ sub send_message { @$nick, @$extra_children]]); } else { my ($xhtml, $text) = xhtml_and_text($message); + # XMPPStreamOut outputs a ref to a scalar as the scalar + # without passing it through the normal escapeHTML() step. + # The HTML $message may have &escape; sequences, which + # xhtml_and_text passes through unaltered, so we need to + # not re-escape even for the plain text body. $self->xml_out([[$NS_COMPONENT, 'message'], {from => $jid_from, to => $jid_to, type => $type}, [[[$NS_COMPONENT, 'body'], - {}, [$text]], + {}, [\$text]], @$nick, @$extra_children, [[$NS_XHTML_IM, 'html'], {}, [[[$NS_XHTML, 'body'], {}, [\$xhtml]]]]]]); -- 2.11.4.GIT