Changeset 5663


Ignore:
Timestamp:
Apr 22, 2008, 4:00:17 AM (14 years ago)
Author:
livings124
Message:

update creator window error parsing to be a bit more expandable (in terms of checking for "http")

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/CreatorWindowController.m

    r5559 r5663  
    205205       
    206206        //check common reasons for failure
    207         if (![trackerString hasPrefix: @"http://"])
     207        NSRange prefixRange = [trackerString rangeOfString: @"://"];
     208        NSString * prefix = [trackerString substringToIndex: prefixRange.location];
     209        if ([prefix caseInsensitiveCompare: @"http"] != NSOrderedSame)
    208210            [alert setMessageText: NSLocalizedString(@"The tracker address must begin with \"http://\".",
    209211                                                    "Create torrent -> warning -> message")];
    210         else if ([trackerString length] == 7) //don't allow blank addresses
     212        else if ([trackerString length] == NSMaxRange(prefixRange)) //don't allow blank addresses
    211213            [alert setMessageText: NSLocalizedString(@"The tracker address cannot be blank.", "Create torrent -> warning -> message")];
    212214        else
Note: See TracChangeset for help on using the changeset viewer.