adium-1.4 2595:93a9f221c29d: Cherry-picked from adium [ca350e061...

commits at adium.im commits at adium.im
Sun Aug 23 03:09:28 UTC 2009


details:	http://hg.adium.im/adium-1.4/rev/93a9f221c29d
revision:	2595:93a9f221c29d
author:		Stephen Holt <sholt at adium.im>
date:		Sat Aug 22 18:58:10 2009 -0400

Cherry-picked from adium [ca350e0610be]: Don't leak this string.
Subject: adium-1.4 2596:387091087c49: Cherry-picked from adium [83fc8295eb5d]: Unit test for new string escaping case

details:	http://hg.adium.im/adium-1.4/rev/387091087c49
revision:	2596:387091087c49
author:		Stephen Holt <sholt at adium.im>
date:		Sat Aug 22 23:10:25 2009 -0400

Cherry-picked from adium [83fc8295eb5d]: Unit test for new string escaping case

diffs (40 lines):

diff -r c8cabd9d5d0d -r 387091087c49 Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m
--- a/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m	Sat Aug 22 15:44:29 2009 -0400
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m	Sat Aug 22 23:10:25 2009 -0400
@@ -118,6 +118,7 @@
 	linkURL = [[NSURL alloc] initWithString:linkString];
 
 	[linkString release];
+	if(preString) [preString release];
 }
 
 - (void)setValidationStatus:(AH_URI_VERIFICATION_STATUS)status
diff -r c8cabd9d5d0d -r 387091087c49 Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m
--- a/Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m	Sat Aug 22 15:44:29 2009 -0400
+++ b/Frameworks/AutoHyperlinks Framework/UnitTests/HyperlinkContextTest.m	Sat Aug 22 23:10:25 2009 -0400
@@ -27,6 +27,16 @@
 	STAssertEqualObjects([[link parentString] substringWithRange:[link range]], nil, @"in context: '%@'", testString);
 }
 
+- (void)testURIEscaping:(NSString *)URIString
+{
+	NSString	*testString = [NSString stringWithFormat:@"%@", URIString];
+	AHHyperlinkScanner	*scanner = [AHHyperlinkScanner hyperlinkScannerWithString:URIString];
+	AHMarkedHyperlink	*link = [scanner nextURI];
+	
+	STAssertNotNil(link, @"-[SHHyperlinkScanner nextURL] found no URI in \"%@\"", URIString);
+	STAssertEqualObjects([[link URL] absoluteString], URIString, @"in context: '%@'", URIString);
+}
+
 #pragma mark positive tests
 - (void)testEnclosedURI:(NSString *)URIString {
 	[self testLaxContext:@"<%@>" withURI:URIString];
@@ -218,6 +228,8 @@
 	[self testLaxContext:@"foo (bar) %@" withURI:@"http://example.com/path/to/url.html"];
 	
 	[self testLaxContext:@"%@" withURI:[NSString stringWithFormat:@"%@",@"http://example.com/hi%uthere"]]; //#11160
+	
+	[self testURIEscaping:[NSString stringWithFormat:@"%@",@"http://www.google.com/search?q=foo%20bar"]]; //#12850
 }
 
 - (void)testCompositeContext {




More information about the commits mailing list