changeset 21299:39231317310a

Escape any un-escaped entities in purple_markup_html_to_xhtml when parsing out URLs, this prevents xmlnode errors and allows suppressing duplicate url <url> because the check whether the description matches the url is now comparing apples to apples. I have no idea if this breaks a bunch of other things that assumed these entities do not get escaped. I'm sure we'll find out sooner or later.
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 10 Nov 2007 15:59:05 +0000
parents 008cfc009d0e
children abbf74f4732b fb2310c914a2
files libpurple/util.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Sat Nov 10 15:55:29 2007 +0000
+++ b/libpurple/util.c	Sat Nov 10 15:59:05 2007 +0000
@@ -1555,7 +1555,11 @@
 							if(*q == '\'' || *q == '\"')
 								q++;
 							while(*q && *q != '\"' && *q != '\'' && *q != ' ') {
-								url = g_string_append_c(url, *q);
+								int len;
+								if ((*q == '&') && (purple_markup_unescape_entity(q, &len) == NULL))
+									url = g_string_append(url, "&amp;");
+								else
+									url = g_string_append_c(url, *q);
 								q++;
 							}
 							p = q;