Mercurial > pidgin
changeset 27846:24e5f6357cb5
merge of 'bc3bb7129b398700639d32f7d6b85fc155053f82'
and 'cd201a23c1b0c9571298b531f87dde3a7c373576'
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Thu, 06 Aug 2009 05:50:42 +0000 |
parents | 13304cc385d7 (diff) 975fc5f64438 (current diff) |
children | 6e619950eda3 |
files | |
diffstat | 2 files changed, 13 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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, "<font color=\"#FF0000\"><font size=\"2\">(%s)</font><b> %s</b></font><br/>\n", date, msg_fixed); else if (type & PURPLE_MESSAGE_WHISPER) written += fprintf(data->file, "<font color=\"#6C2585\"><font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\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, _("<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); + written += fprintf(data->file, _("<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, escaped_from, msg_fixed); else if (type & PURPLE_MESSAGE_RECV) - written += fprintf(data->file, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, from, msg_fixed); + written += fprintf(data->file, _("<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s <AUTO-REPLY>:</b></font> %s<br/>\n"), date, escaped_from, msg_fixed); } else if (type & PURPLE_MESSAGE_RECV) { if(purple_message_meify(msg_fixed, -1)) written += fprintf(data->file, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); else written += fprintf(data->file, "<font color=\"#A82F2F\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\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, "<font color=\"#062585\"><font size=\"2\">(%s)</font> <b>***%s</b></font> %s<br/>\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); else written += fprintf(data->file, "<font color=\"#16569E\"><font size=\"2\">(%s)</font> <b>%s:</b></font> %s<br/>\n", - date, from, msg_fixed); + date, escaped_from, msg_fixed); } else { purple_debug_error("log", "Unhandled message type.\n"); written += fprintf(data->file, "<font size=\"2\">(%s)</font><b> %s:</b></font> %s<br/>\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;