Skip to content

Instantly share code, notes, and snippets.

@jtai
Created November 13, 2011 19:49
Show Gist options
  • Save jtai/1362577 to your computer and use it in GitHub Desktop.
Save jtai/1362577 to your computer and use it in GitHub Desktop.
If there is more than one <HTML> opening tag, skip to the last one
--- pidgin-2.10.0.orig/libpurple/protocols/oscar/oscar.c.orig 2011-11-13 11:52:07.000000000 +0000
+++ pidgin-2.10.0/libpurple/protocols/oscar/oscar.c 2011-11-13 11:45:04.000000000 +0000
@@ -1605,6 +1605,21 @@
tmp = g_strdup(args->msg);
/*
+ * If there is more than one <HTML> opening tag, skip to the last one
+ * This cleans up garbage like: <HTML><BODY><HTML><BODY BGCOLOR="#ffffff"><FONT>message</FONT></BODY></HTML>
+ */
+ while (purple_markup_find_tag("html", tmp + 6, &start, &end, &attribs))
+ {
+ gchar *tmp2;
+
+ g_datalist_clear(&attribs);
+
+ tmp2 = g_strdup(start);
+ g_free(tmp);
+ tmp = tmp2;
+ }
+
+ /*
* Convert iChat color tags to normal font tags.
*/
if (purple_markup_find_tag("body", tmp, &start, &end, &attribs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment