]> git.0d.be Git - empathy.git/commitdiff
Make sure double quotes are not considered part of URIs
authorGustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Tue, 24 Nov 2009 16:27:58 +0000 (14:27 -0200)
committerGustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
Tue, 24 Nov 2009 16:45:18 +0000 (14:45 -0200)
The fact that the URI regex we use to detect URIs in chat
conversations does not exclude double quotes causes it to pick up more
of the text than it should, in some cases.

Bug #598381

libempathy-gtk/empathy-ui-utils.c

index 9ba01738df4d2909513ed0fb3122ebb095ada3e5..ce5ec419e8ab6a0cc4dbf165bb7ad23254496447 100644 (file)
@@ -51,8 +51,8 @@
 
 #define SCHEMES "(https?|s?ftps?|nntp|news|javascript|about|ghelp|apt|telnet|"\
                "file|webcal|mailto)"
-#define BODY "([^\\ \\n]+)"
-#define END_BODY "([^\\ \\n]*[^,;\?><()\\ \"\\.\\n])"
+#define BODY "([^\\ \\n\"]+)"
+#define END_BODY "([^\\ \\n\"]*[^,;\?><()\\ \"\\.\\n])"
 #define URI_REGEX "("SCHEMES"://"END_BODY")" \
                  "|((mailto:)?"BODY"@"BODY"\\."END_BODY")"\
                  "|((www|ftp)\\."END_BODY")"