# HG changeset patch # User Luke Schierer # Date 1080503623 0 # Node ID 5cb93726e4d5c9220f2699dcadf7f37e41b8ee74 # Parent 5b25f72c4723126902ec3661eb19d6adea6eedcd [gaim-migrate @ 9256] "The problem I noticed with the in plain text logging was that it was logged correctly as plain text but the log reading was not doing html escaping. I also noticed that because all sent text is now marked up in html, things like < > and & were logged as < > and & etc. This patch fixes the above problems by improving the markup stripping before writing the log and escaping html while reading the log (only affects plain text logging). I would have posted to sourceforge, but it seems to be having problems at the moment. If I get a chance I'll post it there too." --Stu Tomlinson Nathan, this should fixe the issues you were hitting committer: Tailor Script diff -r 5b25f72c4723 -r 5cb93726e4d5 src/log.c --- a/src/log.c Sun Mar 28 18:00:04 2004 +0000 +++ b/src/log.c Sun Mar 28 19:53:43 2004 +0000 @@ -689,7 +689,7 @@ static char *txt_logger_read(GaimLog *log, GaimLogReadFlags *flags) { - char *read, *minus_header; + char *read, *minus_header, *minus_header2; struct generic_logger_data *data = log->logger_data; *flags = 0; if (!data || !data->path) @@ -701,7 +701,9 @@ else minus_header = g_strdup(minus_header + 1); g_free(read); - return minus_header; + minus_header2 = gaim_escape_html(minus_header); + g_free(minus_header); + return minus_header2; } return g_strdup(_("Could not read file: %s")); } diff -r 5b25f72c4723 -r 5cb93726e4d5 src/util.c --- a/src/util.c Sun Mar 28 18:00:04 2004 +0000 +++ b/src/util.c Sun Mar 28 19:53:43 2004 +0000 @@ -1042,6 +1042,13 @@ { if (str2[i] == '<') { + if (strncasecmp(str2 + i, "
", 4) == 0) + { + str2[j++] = '\n'; + i = i + 3; + continue; + } + k = i + 1; if(g_ascii_isspace(str2[k])) @@ -1079,6 +1086,27 @@ continue; } + if (str2[i] == '&' && strncasecmp(str2 + i, "&", 5) == 0) + { + str2[j++] = '&'; + i = i + 4; + continue; + } + + if (str2[i] == '&' && strncasecmp(str2 + i, "<", 4) == 0) + { + str2[j++] = '<'; + i = i + 3; + continue; + } + + if (str2[i] == '&' && strncasecmp(str2 + i, ">", 4) == 0) + { + str2[j++] = '>'; + i = i + 3; + continue; + } + if (visible) str2[j++] = str2[i]; }