mirror of
https://github.com/transmission/transmission
synced 2025-02-23 14:40:43 +00:00
update creator window error parsing to be a bit more expandable (in terms of checking for "http")
This commit is contained in:
parent
29b0b33663
commit
3f198f365d
1 changed files with 4 additions and 2 deletions
|
@ -204,10 +204,12 @@
|
||||||
[alert setAlertStyle: NSWarningAlertStyle];
|
[alert setAlertStyle: NSWarningAlertStyle];
|
||||||
|
|
||||||
//check common reasons for failure
|
//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://\".",
|
[alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\".",
|
||||||
"Create torrent -> warning -> message")];
|
"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")];
|
[alert setMessageText: NSLocalizedString(@"The tracker address cannot be blank.", "Create torrent -> warning -> message")];
|
||||||
else
|
else
|
||||||
[alert setMessageText: NSLocalizedString(@"The tracker address is invalid.", "Create torrent -> warning -> message")];
|
[alert setMessageText: NSLocalizedString(@"The tracker address is invalid.", "Create torrent -> warning -> message")];
|
||||||
|
|
Loading…
Reference in a new issue