mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Don't double-encode URLs before parsing them
<https://code.google.com/p/macvim/issues/detail?id=316> wasn't a bug. When you're constructing a URL, you *should* end up escaping URL-unsafe characters twice: once for the `file:` URL and once for the `mvim:` URL. Escaping it inside MacVim breaks legit URLs with escapes at the `mvim:` level.
This commit is contained in:
@@ -1659,12 +1659,9 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
- (void)handleGetURLEvent:(NSAppleEventDescriptor *)event
|
||||
replyEvent:(NSAppleEventDescriptor *)reply
|
||||
{
|
||||
NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject]
|
||||
stringValue];
|
||||
// NOTE: URLWithString requires string to be percent escaped.
|
||||
urlString = [urlString stringByAddingPercentEscapesUsingEncoding:
|
||||
NSUTF8StringEncoding];
|
||||
NSURL *url = [NSURL URLWithString:urlString];
|
||||
NSURL *url = [NSURL URLWithString:[[event
|
||||
paramDescriptorForKeyword:keyDirectObject]
|
||||
stringValue]];
|
||||
|
||||
// We try to be compatible with TextMate's URL scheme here, as documented
|
||||
// at http://blog.macromates.com/2007/the-textmate-url-scheme/ . Currently,
|
||||
|
||||
Reference in New Issue
Block a user