changeset 12640:de306144dc8a

[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. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 23 Dec 2005 06:48:27 +0000
parents 366326fa9cb4
children e0e8b0735c5a
files src/util.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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++] = '(';