Ver Fonte

fix listing favorite

Marino Faggiana há 7 anos atrás
pai
commit
a2bad0a9fc
1 ficheiros alterados com 5 adições e 3 exclusões
  1. 5 3
      iOSClient/Networking/OCNetworking.m

+ 5 - 3
iOSClient/Networking/OCNetworking.m

@@ -629,9 +629,11 @@
             }
             // ------------------------
             
-            NSString *serverUrl = [NSString stringWithFormat:@"%@/files/%@", dav, _activeUser];
-            serverUrl = [itemDto.filePath stringByReplacingOccurrencesOfString:serverUrl withString:@""];
-            
+            NSRange firstInstance = [itemDto.filePath rangeOfString:[NSString stringWithFormat:@"%@/files/%@", dav, _activeUser]];
+            NSRange finalRange = NSMakeRange(firstInstance.location + firstInstance.length, itemDto.filePath.length-(firstInstance.location + firstInstance.length));
+
+            NSString *serverUrl = [itemDto.filePath substringWithRange:finalRange];
+
             /* TRIM */
             if ([serverUrl hasPrefix:@"/"])
                 serverUrl = [serverUrl substringFromIndex:1];