You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/05/01 16:05:03 UTC
git commit: CB-6583 ios: Fix failing to create entry when space in
parent path
Repository: cordova-plugin-file
Updated Branches:
refs/heads/master 586e5bd96 -> 6de11c05c
CB-6583 ios: Fix failing to create entry when space in parent path
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/commit/6de11c05
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/6de11c05
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/6de11c05
Branch: refs/heads/master
Commit: 6de11c05c50fd36710b6468639f63dd739576576
Parents: 586e5bd
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu May 1 10:04:20 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu May 1 10:04:20 2014 -0400
----------------------------------------------------------------------
src/ios/CDVLocalFilesystem.m | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/6de11c05/src/ios/CDVLocalFilesystem.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVLocalFilesystem.m b/src/ios/CDVLocalFilesystem.m
index d3cc619..db3433d 100644
--- a/src/ios/CDVLocalFilesystem.m
+++ b/src/ios/CDVLocalFilesystem.m
@@ -119,17 +119,18 @@
- (CDVFilesystemURL *)URLforFullPath:(NSString *)fullPath
{
if (fullPath) {
+ NSString* escapedPath = [fullPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
if ([fullPath hasPrefix:@"/"]) {
- return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, fullPath]];
+ return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
}
- return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@/%@", kCDVFilesystemURLPrefix, self.name, fullPath]];
+ return [CDVFilesystemURL fileSystemURLWithString:[NSString stringWithFormat:@"%@://localhost/%@/%@", kCDVFilesystemURLPrefix, self.name, escapedPath]];
}
return nil;
}
- (CDVFilesystemURL *)URLforFilesystemPath:(NSString *)path
{
- return [self URLforFullPath:[[self fullPathForFileSystemPath:path] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ return [self URLforFullPath:[self fullPathForFileSystemPath:path]];
}
@@ -187,7 +188,7 @@
// We concatenate the two paths together, and then scan the resulting string to remove
// parent ("..") references. Any parent references at the beginning of the string are
// silently removed.
- NSString *combinedPath = [baseURI.fullPath stringByAppendingPathComponent:[requestedPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
+ NSString *combinedPath = [baseURI.fullPath stringByAppendingPathComponent:requestedPath];
combinedPath = [self normalizePath:combinedPath];
CDVFilesystemURL* requestedURL = [self URLforFullPath:combinedPath];