diff --git a/macosx/CreatorWindowController.m b/macosx/CreatorWindowController.m index 48a822875..214d8117a 100644 --- a/macosx/CreatorWindowController.m +++ b/macosx/CreatorWindowController.m @@ -204,10 +204,12 @@ [alert setAlertStyle: NSWarningAlertStyle]; //check common reasons for failure - if (![trackerString hasPrefix: @"http://"]) + NSRange prefixRange = [trackerString rangeOfString: @"://"]; + NSString * prefix = [trackerString substringToIndex: prefixRange.location]; + if ([prefix caseInsensitiveCompare: @"http"] != NSOrderedSame) [alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\".", "Create torrent -> warning -> message")]; - else if ([trackerString length] == 7) //don't allow blank addresses + else if ([trackerString length] == NSMaxRange(prefixRange)) //don't allow blank addresses [alert setMessageText: NSLocalizedString(@"The tracker address cannot be blank.", "Create torrent -> warning -> message")]; else [alert setMessageText: NSLocalizedString(@"The tracker address is invalid.", "Create torrent -> warning -> message")];