Skip to content

Commit 998b2ff

Browse files
author
Pablo Carrascal
committed
- [Universal links] Fixed some cases when the server has subpaths
1 parent ecaff2b commit 998b2ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Owncloud iOs Client/OpenInApp/OpenInAppHandler.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ -(NSString *)_getFilePathFromURLWithURL: (NSString *)url andFileName: (NSString
161161
-(void)_isItemDirectory: (NSString *)itemPath completionHandler:(void (^)(BOOL isDirectory, NSError * error))completionHandler
162162
{
163163
NSError *error = NULL;
164-
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(.*)\/remote.php\/dav\/files\/[^\/]*" options:NSRegularExpressionCaseInsensitive error:&error];
164+
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(.*)\/remote.php\/dav\/files\/[^\/]*\/" options:NSRegularExpressionCaseInsensitive error:&error];
165165
NSString *result = [regex stringByReplacingMatchesInString:itemPath options:0 range:NSMakeRange(0, [itemPath length]) withTemplate:@""];
166166

167-
NSString *path = [[UtilsUrls getRemoteServerPathWithoutFolders:_user] stringByAppendingString: [@"/" stringByAppendingString:[k_url_webdav_server_without_last_slash stringByAppendingString:result]]];
167+
NSString *path = [[UtilsUrls getFullRemoteServerPathWithWebDav:_user] stringByAppendingString:result];
168168

169169
[[AppDelegate sharedOCCommunication] readFile:path onCommunication: [AppDelegate sharedOCCommunication] successRequest:^(NSHTTPURLResponse *response, NSArray *items, NSString *redirectedServer)
170170
{

0 commit comments

Comments
 (0)