Commit 5192c7c9 authored by Jörg Bleyel's avatar Jörg Bleyel Committed by Felix Paul Kühne

don't prepend http:// if already exists

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 69362184
......@@ -146,9 +146,12 @@
/* Safari & al mangle vlc://http:// so fix this */
if (location != NSNotFound && [parsedString characterAtIndex:location - 1] != 0x3a) { // :
parsedString = [NSString stringWithFormat:@"%@://%@", [parsedString substringToIndex:location], [parsedString substringFromIndex:location+2]];
} else
parsedString = [@"http://" stringByAppendingString:[receivedUrl substringFromIndex:6]];
} else {
parsedString = [receivedUrl substringFromIndex:6];
if (![parsedString hasPrefix:@"http://"] && ![parsedString hasPrefix:@"https://"] && ![parsedString hasPrefix:@"ftp://"]) {
parsedString = [@"http://" stringByAppendingString:[receivedUrl substringFromIndex:6]];
}
}
url = [NSURL URLWithString:parsedString];
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment