diff src/util.c @ 8517:5cb93726e4d5

[gaim-migrate @ 9256] "The problem I noticed with the <AUTO RESPONSE> 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 &lt; &gt and &amp; 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 <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 28 Mar 2004 19:53:43 +0000
parents 29aa90459620
children 389e2b9dae6a
line wrap: on
line diff
--- 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, "<br>", 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, "&amp;", 5) == 0)
+		{
+			str2[j++] = '&';
+			i = i + 4;
+			continue;
+		}
+
+		if (str2[i] == '&' && strncasecmp(str2 + i, "&lt;", 4) == 0)
+		{
+			str2[j++] = '<';
+			i = i + 3;
+			continue;
+		}
+
+		if (str2[i] == '&' && strncasecmp(str2 + i, "&gt;", 4) == 0)
+		{
+			str2[j++] = '>';
+			i = i + 3;
+			continue;
+		}
+
 		if (visible)
 			str2[j++] = str2[i];
 	}