Skip to content

Commit

Permalink
Fixed a bug with URLs starting with www.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktoumpelis committed Jun 7, 2009
1 parent 203d7eb commit 0592a12
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ - (NSString *) detectURL:(NSString *)string {
NSRange charsetRange = [substring
rangeOfCharacterFromSet:[self httpDelimitingCharset]];
if (charsetRange.location == NSNotFound) {
return substring;
if ([substring length] > 10) {
return substring;
}
} else {
return [substring substringToIndex:charsetRange.location];
if ([[substring substringToIndex:charsetRange.location]
length] > 10) {
return [substring substringToIndex:charsetRange.location];
}
}
}

Expand Down

0 comments on commit 0592a12

Please sign in to comment.