[gaim-migrate @ 14976]

Fri, 23 Dec 2005 06:48:27 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Fri, 23 Dec 2005 06:48:27 +0000
changeset 12640
1fb40d5d76e7
parent 12639
7df970d037c3
child 12641
62329a68eb7b

[gaim-migrate @ 14976]
Yahoo profiles use links of this form:
<a href="http://gaim.sf.net">gaim.sf.net</a>

The Yahoo prpl strips HTML, manipulates the text, then passes it to the core, which passes to the UI, which calls another UI function which calls ...linkify. This leads to these URLs looking quite odd.

The fix is to have the HTML stripping function deal properly with URLs of the above format. With HTTP being the most common type of URL these days, that's probably a good plan anyway.

src/util.c file | annotate | diff | comparison | revisions
--- a/src/util.c	Fri Dec 23 05:13:52 2005 +0000
+++ b/src/util.c	Fri Dec 23 06:48:27 2005 +0000
@@ -1357,8 +1357,10 @@
 					size_t hrlen = strlen(href);
 
 					/* Only insert the href if it's different from the CDATA. */
-					if (hrlen != j - href_st  ||
-					    strncmp(str2 + href_st, href, hrlen))
+					if ((hrlen != j - href_st ||
+					     strncmp(str2 + href_st, href, hrlen)) &&
+					    (hrlen != j - href_st + 7 || /* 7 == strlen("http://") */
+					     strncmp(str2 + href_st, href + 7, hrlen - 7)))
 					{
 						str2[j++] = ' ';
 						str2[j++] = '(';

mercurial