You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ia...@apache.org on 2014/09/11 19:57:17 UTC

[1/2] git commit: CB-7423 encode path before attempting to resolve

Repository: cordova-plugin-file
Updated Branches:
  refs/heads/master 9a456100e -> cc14f0577


CB-7423 encode path before attempting to resolve


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/fefedeed
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/fefedeed
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/fefedeed

Branch: refs/heads/master
Commit: fefedeedd83c6dfc422c9dfc3b806121ecaab162
Parents: ca5b947
Author: Edna Morales <ey...@us.ibm.com>
Authored: Tue Sep 2 17:06:18 2014 -0400
Committer: Edna Morales <ey...@us.ibm.com>
Committed: Tue Sep 2 17:06:18 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVFile.m | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/blob/fefedeed/src/ios/CDVFile.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVFile.m b/src/ios/CDVFile.m
index 0975340..fcc5100 100644
--- a/src/ios/CDVFile.m
+++ b/src/ios/CDVFile.m
@@ -538,6 +538,8 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
     // arguments
     NSString* localURIstr = [command.arguments objectAtIndex:0];
     CDVPluginResult* result;
+    
+    localURIstr = [self encodePath:localURIstr]; //encode path before resolving
     CDVFilesystemURL* inputURI = [self fileSystemURLforArg:localURIstr];
     
     if (inputURI == nil || inputURI.fileSystemName == nil) {
@@ -553,6 +555,13 @@ NSString* const kCDVFilesystemURLPrefix = @"cdvfile";
     [self.commandDelegate sendPluginResult:result callbackId:command.callbackId];
 }
 
+//encode path with percent escapes
+-(NSString *)encodePath:(NSString *)path
+{
+    NSString *decodedPath = [path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //decode incase it's already encoded to avoid encoding twice
+    return [decodedPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
+}
+
 
 /* Part of DirectoryEntry interface,  creates or returns the specified directory
  * IN:


[2/2] git commit: Merge remote-tracking branch 'eymorale/CB-7423'

Posted by ia...@apache.org.
Merge remote-tracking branch 'eymorale/CB-7423'


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/cc14f057
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/tree/cc14f057
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-file/diff/cc14f057

Branch: refs/heads/master
Commit: cc14f05777171a579c05f0adafedc7d94890cd6f
Parents: 9a45610 fefedee
Author: Ian Clelland <ic...@chromium.org>
Authored: Thu Sep 11 13:53:33 2014 -0400
Committer: Ian Clelland <ic...@chromium.org>
Committed: Thu Sep 11 13:53:33 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVFile.m | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------