1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

remove potentially invalid tracker url's in the creator window

This commit is contained in:
Mitchell Livingston 2008-08-14 21:47:23 +00:00
parent d7ab0d8a15
commit fa2bc23cda

View file

@ -111,7 +111,7 @@
{
fTrackers = [[NSMutableArray alloc] initWithCapacity: 1];
//check for tracker from versions before 1.3
//check for single tracker from versions before 1.3
NSString * tracker;
if ((tracker = [fDefaults stringForKey: @"CreatorTracker"]))
{
@ -120,6 +120,14 @@
[fDefaults setObject: fTrackers forKey: @"CreatorTrackers"];
}
}
//remove potentially invalid addresses
NSInteger i;
for (i = [fTrackers count]-1; i >= 0; i--)
{
if (!tr_httpIsValidURL([[fTrackers objectAtIndex: i] UTF8String]))
[fTrackers removeObjectAtIndex: i];
}
}
return self;
}