adium 4037:ec92ca1d3d06: Fix case where URIs with query parts bu...

commits at adium.im commits at adium.im
Sat Jul 2 22:07:49 UTC 2011


details:	http://hg.adium.im/adium/rev/ec92ca1d3d06
revision:	4037:ec92ca1d3d06
branch:		(none)
author:		Stephen Holt <sholt at adium.im>
date:		Sat Jul 02 15:07:45 2011 -0700

Fix case where URIs with query parts but no path parts were not linked: ex: http://example.com?query=yes

diffs (25 lines):

diff -r 6c903329d574 -r ec92ca1d3d06 Frameworks/AutoHyperlinks Framework/Source/AHLinkLexer.l
--- a/Frameworks/AutoHyperlinks Framework/Source/AHLinkLexer.l	Tue Jun 28 19:50:34 2011 -0700
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHLinkLexer.l	Sat Jul 02 15:07:45 2011 -0700
@@ -58,8 +58,9 @@
 singleDomain    [_[:alnum:]\x80-\xf4-]+
 
 urlPath         \/[^[:space:]]*
-urlSpec         ({singleDomain}\.)+{TLDs}(:[0-9]+)?{urlPath}?
-urlCSpec        {singleDomain}(\.{singleDomain})*(:[0-9]+)?{urlPath}?
+urlQuery        \?.*
+urlSpec         ({singleDomain}\.)+{TLDs}(:[0-9]+)?({urlPath}|{urlQuery})?
+urlCSpec        {singleDomain}(\.{singleDomain})*(:[0-9]+)?({urlPath}|{urlQuery})?
 
 ipv4address     ([0-9]{1,3}\.){3}([0-9]{1,3})
 ipURL           {ipv4address}(:[0-9]+)?{urlPath}?
diff -r 6c903329d574 -r ec92ca1d3d06 Frameworks/AutoHyperlinks Framework/UnitTests/SimpleURLTest.m
--- a/Frameworks/AutoHyperlinks Framework/UnitTests/SimpleURLTest.m	Tue Jun 28 19:50:34 2011 -0700
+++ b/Frameworks/AutoHyperlinks Framework/UnitTests/SimpleURLTest.m	Sat Jul 02 15:07:45 2011 -0700
@@ -492,5 +492,6 @@
 	testHyperlink(@"http://example.not.a.tld:8080/");
 	testHyperlink(@"http://example.not.a.tld/stuff");
 	testHyperlink(@"http://example.not.a.tld:8080/stuff");
+	testHyperlink(@"http://example.com?query=yes");
 }
 @end




More information about the commits mailing list