[
https://issues.apache.org/jira/browse/CB-9991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Denis Babineau updated CB-9991:
-------------------------------
Environment:
cordova 5.3.3
cordova ios 3.9.1
cordova-plugin-file 2.0.0
iOS
> resolveLocalFileSystemURL returns extra leading slash in nativeURL for some
> paths
> ---------------------------------------------------------------------------------
>
> Key: CB-9991
> URL: https://issues.apache.org/jira/browse/CB-9991
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS, Plugin File
> Environment: cordova 5.3.3
> cordova ios 3.9.1
> cordova-plugin-file 2.0.0
> iOS
> Reporter: Denis Babineau
> Labels: ios
>
> The following:
> window.resolveLocalFileSystemURL(cordova.file.applicationDirectory,
> function(e) { console.log("OK:", e); }, function(e) { console.log("ERR:", e);
> });
> returns an object with nativeURL that looks like this (notice the 4 slashes
> past the protocol, should be 3 slashes):
> "file:////var/mobile/Containers/Bundle/Application/EC6F4A71-B8A8-4156-A43B-C7CB4F39FA19/Test.app/"
> I narrowed it down to CDVLocalFilesystem.m's filesystemPathForFullPath
> implementation not handling extra leading slashes properly when fsRoot == '/':
> - (NSString *)filesystemPathForFullPath:(NSString *)fullPath
> {
> NSString *path = nil;
> NSString *strippedFullPath = [self stripQueryParametersFromPath:fullPath];
> path = [NSString stringWithFormat:@"%@%@", self.fsRoot, strippedFullPath];
> if ([path length] > 1 && [path hasSuffix:@"/"]) {
> path = [path substringToIndex:([path length]-1)];
> }
> return path;
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]