GNOME Bugzilla – Bug 102881
URLs with commas not parsed completely
Last modified: 2004-12-22 21:47:04 UTC
URLs in the message body are automagically turned into clickable hyperlinks. It seems the URL parser reproducibly stops at the first comma it finds, although this is a valid character in hyperlinks, so any link into e.g. time.com will be cut off right before the first comma.
fejj: we're using gmime's url_extract() for this. Any objection against the following patch? diff -u -r1.6 gmime-filter-html.c --- gmime-filter-html.c 30 Dec 2002 21:33:30 -0000 1.6 +++ gmime-filter-html.c 9 Jan 2003 20:54:24 -0000 @@ -113,12 +113,12 @@ } /* 1 = non-email-address chars: "()<>@,;:\\\"/[]`'|\n\t " */ -/* 2 = non-url chars: "()<>,;\\\"[]`'|\n\t " */ +/* 2 = non-url chars: "()<>;\\\"[]`'|\n\t " */ /* 3 = trailing url garbage: ",.!?;:>)]}\\`'-_|\n\t " */ static unsigned short special_chars[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 4, 3, 0, 0, 0, 0, 7, 3, 7, 0, 0, 7, 4, 4, 1, + 7, 4, 3, 0, 0, 0, 0, 7, 3, 7, 0, 0, 4, 4, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 3, 0, 7, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 3, 0, 4, @@ -140,7 +140,7 @@ #define IS_GARBAGE (1 << 2) #define NON_EMAIL_CHARS "()<>@,;:\\\"/[]`'|\n\t " -#define NON_URL_CHARS "()<>,;\\\"[]`'|\n\t " +#define NON_URL_CHARS "()<>;\\\"[]`'|\n\t " #define TRAILING_URL_GARBAGE ",.!?;:>)}\\`'-_|\n\t " #define is_addr_char(c) (isprint ((int) c) && !(special_chars[(unsigned char) c] & IS_NON_ADDR))
you can do whatever you want to your copy of gmime-filter-html.c ;-) I've rewritten gmime's gmime-filter-html.c tho, the code is now much cleaner... you guys may actually want to update to using the newer code (though it doesn't offer a url_extract() function anymore which I seem to recall charles asking me to make public at one point, but instead I do have something even better - take a look at url-scanner.c)
Fixed in CVS for 0.13.4: http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/gmime&command=DIFF_FRAMESET&file=gmime-filter-html.c&rev1=1.6&rev2=1.7&root=/cvs/gnome
*** Bug 105269 has been marked as a duplicate of this bug. ***
*** Bug 106436 has been marked as a duplicate of this bug. ***