# HG changeset patch # User Paul Aurich # Date 1249537842 0 # Node ID 24e5f6357cb53259bf82dfa58e97bcdf4a6327b1 # Parent 13304cc385d7fb9180b9423df2d0def3686a7d26# Parent 975fc5f6443804625eb67ccdfac23ab15462b714 merge of 'bc3bb7129b398700639d32f7d6b85fc155053f82' and 'cd201a23c1b0c9571298b531f87dde3a7c373576' diff -r 975fc5f64438 -r 24e5f6357cb5 ChangeLog --- a/ChangeLog Thu Aug 06 05:25:23 2009 +0000 +++ b/ChangeLog Thu Aug 06 05:50:42 2009 +0000 @@ -46,6 +46,7 @@ * Build properly on Hurd. (Marc Dequènes) * Various memory leaks fixed as reported by Josh Mueller. * Properly handle an IRC buddy appearing in multiple groups. + * Escape HTML entities in usernames when written with the HTML logger. AIM and ICQ: * Preliminary support for a new authentication scheme called diff -r 975fc5f64438 -r 24e5f6357cb5 libpurple/log.c --- a/libpurple/log.c Thu Aug 06 05:25:23 2009 +0000 +++ b/libpurple/log.c Thu Aug 06 05:50:42 2009 +0000 @@ -1375,6 +1375,7 @@ char *image_corrected_msg; char *date; char *header; + char *escaped_from; PurplePlugin *plugin = purple_find_prpl(purple_account_get_protocol_id(log->account)); PurpleLogCommonLoggerData *data = log->logger_data; gsize written = 0; @@ -1413,6 +1414,8 @@ if(!data->file) return 0; + escaped_from = g_markup_escape_text(from, -1); + image_corrected_msg = convert_image_tags(log, message); purple_markup_html_to_xhtml(image_corrected_msg, &msg_fixed, NULL); @@ -1434,34 +1437,35 @@ written += fprintf(data->file, "(%s) %s
\n", date, msg_fixed); else if (type & PURPLE_MESSAGE_WHISPER) written += fprintf(data->file, "(%s) %s: %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); else if (type & PURPLE_MESSAGE_AUTO_RESP) { if (type & PURPLE_MESSAGE_SEND) - written += fprintf(data->file, _("(%s) %s <AUTO-REPLY>: %s
\n"), date, from, msg_fixed); + written += fprintf(data->file, _("(%s) %s <AUTO-REPLY>: %s
\n"), date, escaped_from, msg_fixed); else if (type & PURPLE_MESSAGE_RECV) - written += fprintf(data->file, _("(%s) %s <AUTO-REPLY>: %s
\n"), date, from, msg_fixed); + written += fprintf(data->file, _("(%s) %s <AUTO-REPLY>: %s
\n"), date, escaped_from, msg_fixed); } else if (type & PURPLE_MESSAGE_RECV) { if(purple_message_meify(msg_fixed, -1)) written += fprintf(data->file, "(%s) ***%s %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); else written += fprintf(data->file, "(%s) %s: %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); } else if (type & PURPLE_MESSAGE_SEND) { if(purple_message_meify(msg_fixed, -1)) written += fprintf(data->file, "(%s) ***%s %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); else written += fprintf(data->file, "(%s) %s: %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); } else { purple_debug_error("log", "Unhandled message type.\n"); written += fprintf(data->file, "(%s) %s: %s
\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); } } g_free(date); g_free(msg_fixed); + g_free(escaped_from); fflush(data->file); return written;