After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 609942 - URLs are split at apostrophes
URLs are split at apostrophes
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-14 20:14 UTC by Jean-François Fortin Tam
Modified: 2010-11-02 09:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (676 bytes, patch)
2010-09-21 16:11 UTC, Vitaly Minko
reviewed Details | Review
updated patch (2.79 KB, patch)
2010-09-22 19:05 UTC, Vitaly Minko
none Details | Review

Description Jean-François Fortin Tam 2010-02-14 20:14:09 UTC
If you have a url such as http://foo.com/bar'baz.jpg (which works fine in browsers usually), it breaks.

Maybe there are other characters that also "break" the URLs, I haven't tested fully. This might be related to bug #607032
Comment 1 Vitaly Minko 2010-09-21 16:11:36 UTC
Created attachment 170764 [details] [review]
proposed fix

According to http://www.ietf.org/rfc/rfc1738.txt,
apostrophe is allowed in URLs with http/ftp and mailto schemas.
Comment 2 Xavier Claessens 2010-09-21 16:54:52 UTC
You should add ' in INVALID_CHARS_EXT then, to avoid matching the ' when being at the of the URL. For example if you are sending HTML code like that: <a href='http://google.com'>

Please aslo add test cases in empathy/tests/empathy-parser-test.c
Comment 3 Vitaly Minko 2010-09-22 19:05:24 UTC
Created attachment 170856 [details] [review]
updated patch

Fixed.

I added "<>" to INVALID_CHARS in order to handle <a> tags in comments properly. These chars are not allowed neither in http nor in email links.

I also separated "?'" from INVALID_CHARS_EXT since these chars are not forbidden in local-part of mailto links according to http://tools.ietf.org/html/rfc5322#section-3.4.1
Comment 4 Vitaly Minko 2010-10-28 13:28:25 UTC
Ping
Comment 5 Xavier Claessens 2010-10-28 13:50:25 UTC
Looks fine

Just a little detail, I would remove BODY_START and make
BODY_STRICT  "([^"INVALID_CHARS_FULL"])([^"INVALID_CHARS_EXT"]*)"
to avoid having too much different BODY_FOO defined that make things messy.

Also I'm wondering why we have BODY, it is used only for the server part in email addresses. Shouldn't it be BODY_STRICT too? If you agree we could just remove BODY and rename BODY_STRICT to BODY.
Comment 6 Vitaly Minko 2010-11-01 16:04:59 UTC
Agreed. Updated in
repo: git://vminko.org/empathy
branch: fix-609942
Comment 7 Xavier Claessens 2010-11-02 08:50:42 UTC
Looks fine, you can merge that branch :)
Comment 8 Guillaume Desmottes 2010-11-02 09:05:54 UTC
I merged it as Vitaly doesn't have a GNOME account.
Thanks to both of you guys!

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.