[evolution-patches] Fix for bug #256142 [gtkhtml]



Hi

Attached Fix for bug#256142 - URL parser doesn't properly parse
trailing . in hostnames.

Please Review

Thanks,
Rohini

Index: htmltext.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/htmltext.c,v
retrieving revision 1.285
diff -u -p -r1.285 htmltext.c
--- htmltext.c	26 Sep 2005 07:07:21 -0000	1.285
+++ htmltext.c	4 Jan 2006 09:46:23 -0000
@@ -2933,9 +2933,9 @@ struct _HTMLMagicInsertMatch
 typedef struct _HTMLMagicInsertMatch HTMLMagicInsertMatch;
 
 static HTMLMagicInsertMatch mim [] = {
-	{ "(news|telnet|nttp|file|http|ftp|https)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-a-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, NULL },
-	{ "www\\.[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "http://"; },
-	{ "ftp\\.[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "ftp://"; },
+	{ "(news|telnet|nttp|file|http|ftp|https)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(([.])?/[-a-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, NULL },
+	{ "www\\.[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(([.])?/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "http://"; },
+	{ "ftp\\.[-a-z0-9.]+[-a-z0-9](:[0-9]*)?(([.])?/[-A-Za-z0-9_$.+!*(),;:@%&=?/~#]*[^]'.}>\\) ,?!;:\"]?)?", NULL, "ftp://"; },
 	{ "[-_a-z0-9.'\\+]+ [-_a-z0-9 ]+", NULL, "mailto:"; }
 };
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2151
diff -u -p -r1.2151 ChangeLog
--- ChangeLog	22 Oct 2005 10:25:26 -0000	1.2151
+++ ChangeLog	4 Jan 2006 09:46:33 -0000
@@ -1,3 +1,9 @@
+2006-01-04  Rohini S  <srohini novell com>
+
+	* htmltext.c: Regular expressions in HTMLMagicInsertMatch array mim changed
+
+	Fixes bug #256142
+
 2005-10-22  Kaushal Kumar  <kakumar novell com>
 
 	* htmlprinter.c (draw_border): Do not draw peripheral border since
Index: camel-url-scanner.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-url-scanner.c,v
retrieving revision 1.19
diff -u -p -r1.19 camel-url-scanner.c
--- camel-url-scanner.c	6 Dec 2005 04:21:55 -0000	1.19
+++ camel-url-scanner.c	9 Jan 2006 11:46:34 -0000
@@ -356,8 +356,8 @@ camel_url_web_end (const char *in, const
 			while (inptr < inend && is_atom (*inptr))
 				inptr++;
 			
-			if ((inptr + 1) < inend && *inptr == '.' && is_atom (inptr[1]))
-				inptr++;
+			if ((inptr + 1) < inend && *inptr == '.' && (is_atom (inptr[1]) || inptr[1] == '/')) 
+					inptr++;
 		}
 		
 		if (*inptr != '@')
@@ -377,8 +377,8 @@ camel_url_web_end (const char *in, const
 			while (inptr < inend && is_domain (*inptr))
 				inptr++;
 			
-			if ((inptr + 1) < inend && *inptr == '.' && is_domain (inptr[1]))
-				inptr++;
+			if ((inptr + 1) < inend && *inptr == '.' && (is_domain (inptr[1]) || inptr[1] == '/')) 
+					inptr++;
 		}
 	} else {
 		return FALSE;
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2508
diff -u -p -r1.2508 ChangeLog
--- ChangeLog	13 Dec 2005 04:58:42 -0000	1.2508
+++ ChangeLog	9 Jan 2006 11:46:53 -0000
@@ -1,3 +1,9 @@
+2006-01-09  Rohini S  <srohini novell com>
+
+	* camel-url-scanner.c (camel_url_web_end): Modified to accept urls 
+	with ./
+	Fixes bug#256142
+
 2005-12-13  Tor Lillqvist  <tml novell com>
 
 	* camel-filter-driver.c: Use gstdio wrappers. Use


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]