Skip to content

Commit

Permalink
Merge pull request wkh237#158 from ihavenoface5/issue-157
Browse files Browse the repository at this point in the history
path sent to unlink is now checked for file prefix.
  • Loading branch information
Traviskn committed Sep 14, 2018
2 parents fd81e46 + 61a343e commit c95ef1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion android/src/main/java/com/RNFetchBlob/RNFetchBlobFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ static void closeStream(String streamId, Callback callback) {
*/
static void unlink(String path, Callback callback) {
try {
RNFetchBlobFS.deleteRecursive(new File(path));
String normalizedPath = normalizePath(path);
RNFetchBlobFS.deleteRecursive(new File(normalizedPath));
callback.invoke(null, true);
} catch(Exception err) {
callback.invoke(err.getLocalizedMessage(), false);
Expand Down

0 comments on commit c95ef1c

Please sign in to comment.