cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Ginchereau (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CB-9991) resolveLocalFileSystemURL returns extra leading slash in nativeURL for some paths
Date Mon, 16 Nov 2015 18:49:10 GMT

     [ https://issues.apache.org/jira/browse/CB-9991?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jason Ginchereau updated CB-9991:
---------------------------------
    Component/s:     (was: 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: 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: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message