Explorar el Código

Merge pull request #158 from ihavenoface5/issue-157

path sent to unlink is now checked for file prefix.
Travis Nuttall hace 6 años
padre
commit
c95ef1c199
No account linked to committer's email address
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2
    1
      android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java

+ 2
- 1
android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java Ver fichero

@@ -490,7 +490,8 @@ class RNFetchBlobFS {
490 490
      */
491 491
     static void unlink(String path, Callback callback) {
492 492
         try {
493
-            RNFetchBlobFS.deleteRecursive(new File(path));
493
+            String normalizedPath = normalizePath(path);
494
+            RNFetchBlobFS.deleteRecursive(new File(normalizedPath));
494 495
             callback.invoke(null, true);
495 496
         } catch(Exception err) {
496 497
             callback.invoke(err.getLocalizedMessage(), false);